public boolean startTurn() { iteration++; int count = 0; count = Client.INSTANCE.getBaseCount(connection); bases = new Base[count]; for (int i = 0; i < count; i++) { bases[i] = new Base(Client.INSTANCE.getBase(connection, i)); } count = Client.INSTANCE.getPlayerCount(connection); players = new Player[count]; for (int i = 0; i < count; i++) { players[i] = new Player(Client.INSTANCE.getPlayer(connection, i)); } count = Client.INSTANCE.getTileCount(connection); tiles = new Tile[count]; for (int i = 0; i < count; i++) { tiles[i] = new Tile(Client.INSTANCE.getTile(connection, i)); } count = Client.INSTANCE.getVirusCount(connection); viruses = new Virus[count]; for (int i = 0; i < count; i++) { viruses[i] = new Virus(Client.INSTANCE.getVirus(connection, i)); } if (!initialized) { initialized = true; init(); } return run(); }
public boolean startTurn() { iteration++; int count = 0; count = Client.INSTANCE.getPlayerCount(connection); players = new Player[count]; for (int i = 0; i < count; i++) { players[i] = new Player(Client.INSTANCE.getPlayer(connection, i)); } count = Client.INSTANCE.getMappableCount(connection); mappables = new Mappable[count]; for (int i = 0; i < count; i++) { mappables[i] = new Mappable(Client.INSTANCE.getMappable(connection, i)); } count = Client.INSTANCE.getTileCount(connection); tiles = new Tile[count]; for (int i = 0; i < count; i++) { tiles[i] = new Tile(Client.INSTANCE.getTile(connection, i)); } count = Client.INSTANCE.getTrapCount(connection); traps = new Trap[count]; for (int i = 0; i < count; i++) { traps[i] = new Trap(Client.INSTANCE.getTrap(connection, i)); } count = Client.INSTANCE.getThiefCount(connection); thieves = new Thief[count]; for (int i = 0; i < count; i++) { thieves[i] = new Thief(Client.INSTANCE.getThief(connection, i)); } count = Client.INSTANCE.getThiefTypeCount(connection); thiefTypes = new ThiefType[count]; for (int i = 0; i < count; i++) { thiefTypes[i] = new ThiefType(Client.INSTANCE.getThiefType(connection, i)); } count = Client.INSTANCE.getTrapTypeCount(connection); trapTypes = new TrapType[count]; for (int i = 0; i < count; i++) { trapTypes[i] = new TrapType(Client.INSTANCE.getTrapType(connection, i)); } if (!initialized) { initialized = true; init(); } return run(); }