0
大家好,我想問怎麼才能出去| pc |從環像getPlayer anthor法或等Java for循環[方法]
for (L2PcInstance pc : L2World.getInstance().getPlayers())
{
if (pc.isOnline() && ((pc.getClient() != null) && !pc.getClient().isDetached()))
{
Object[] rowData = new Object[]
{
pc.getAccountName(),
pc.getId(),
pc.getName(),
pc.getLevel(),
pc.getCurrentHp(),
pc.getCurrentMp(),
pc.getCurrentCp(),
pc.getPvpKills(),
pc.getPkKills(),
pc.getBaseClass(),
pc.getCreateDate()
};
model.addRow(rowData);
}
}
IM嘗試一切,但沒有工作可以給我一個人explame :( 在我的想法是這樣的
private L2PcInstance pc;
for (pc : L2World.getInstance().getPlayers())
public L2PcInstance getPlayer()
{
return pc;
}
感謝您的時間像:)
'break'不是方法,而是一個關鍵字,所以應該只是'打破;' – moritzg
會嘗試感謝 – Micr0
它不起作用毫米,我需要我的初始化退出循環,並得到結果在anthor方法中 – Micr0