game.getBoard().setHex((Coords) c.getObject(0), (Hex) c.getObject(1));
game.getBoard().setHex((Coords) c.getObject(0), (IHex) c.getObject(1));
    public void run() {        Thread currentThread = Thread.currentThread();        while(pump == currentThread) {            Packet c = readPacket();            if (c == null) {                System.out.println("client: got null packet"); //$NON-NLS-1$                continue;            }            switch (c.getCommand()) {                case Packet.COMMAND_CLOSE_CONNECTION :                    disconnected();                    break;                case Packet.COMMAND_SERVER_GREETING :                    connected = true;                    send(new Packet(Packet.COMMAND_CLIENT_NAME, name));                    break;                case Packet.COMMAND_LOCAL_PN :                    this.local_pn = c.getIntValue(0);                    break;                case Packet.COMMAND_PLAYER_UPDATE :                    receivePlayerInfo(c);                    break;                case Packet.COMMAND_PLAYER_READY :                    getPlayer(c.getIntValue(0)).setDone(c.getBooleanValue(1));                    break;                case Packet.COMMAND_PLAYER_ADD :                    receivePlayerInfo(c);                    break;                case Packet.COMMAND_PLAYER_REMOVE :                    game.removePlayer(c.getIntValue(0));                    break;                case Packet.COMMAND_CHAT :                    if (null!=serverlog && PreferenceManager.getClientPreferences().keepServerlog()) {                        serverlog.append( (String) c.getObject(0) );                    };                    game.processGameEvent(new GamePlayerChatEvent(this,null, (String) c.getObject(0)));                    break;                case Packet.COMMAND_ENTITY_ADD :                    receiveEntityAdd(c);                    break;                case Packet.COMMAND_ENTITY_UPDATE :                    receiveEntityUpdate(c);                    break;                case Packet.COMMAND_ENTITY_REMOVE :                    receiveEntityRemove(c);                    break;                case Packet.COMMAND_ENTITY_VISIBILITY_INDICATOR :                    receiveEntityVisibilityIndicator(c);                    break;                case Packet.COMMAND_SENDING_MINEFIELDS :                    receiveSendingMinefields(c);                    break;                case Packet.COMMAND_DEPLOY_MINEFIELDS :                    receiveDeployMinefields(c);                    break;                case Packet.COMMAND_REVEAL_MINEFIELD :                    receiveRevealMinefield(c);                    break;                case Packet.COMMAND_REMOVE_MINEFIELD :                    receiveRemoveMinefield(c);                    break;                case Packet.COMMAND_CHANGE_HEX :                    game.getBoard().setHex((Coords) c.getObject(0), (Hex) c.getObject(1));                    break;                case Packet.COMMAND_BLDG_UPDATE_CF :                    receiveBuildingUpdateCF(c);                    break;                case Packet.COMMAND_BLDG_COLLAPSE :                    receiveBuildingCollapse(c);                    break;                case Packet.COMMAND_PHASE_CHANGE :                    changePhase(c.getIntValue(0));                    break;                case Packet.COMMAND_TURN :                    changeTurnIndex(c.getIntValue(0));                    break;                case Packet.COMMAND_ROUND_UPDATE :                    game.setRoundCount(c.getIntValue(0));                    break;                case Packet.COMMAND_SENDING_TURNS :                    receiveTurns(c);                    break;                case Packet.COMMAND_SENDING_BOARD :                    receiveBoard(c);                    break;                case Packet.COMMAND_SENDING_ENTITIES :                    receiveEntities(c);                    break;                case Packet.COMMAND_SENDING_REPORT :                    if (null!=serverlog && PreferenceManager.getClientPreferences().keepServerlog()) {                        if (null==eotr || ((String) c.getObject(0)).length() < eotr.length() ) {                            // first report packet                            serverlog.append( (String) c.getObject(0) );                        } else {                            // append only the new part, not what's already in eotr                            serverlog.append( ((String) c.getObject(0)).substring(eotr.length()) );                        };                    };                    eotr = (String) c.getObject(0);                    game.processGameEvent(new GameReportEvent(this));                    break;                case Packet.COMMAND_ENTITY_ATTACK :                    receiveAttack(c);                    break;                case Packet.COMMAND_SENDING_GAME_SETTINGS :                    game.setOptions((GameOptions) c.getObject(0));                    break;                case Packet.COMMAND_SENDING_MAP_SETTINGS :                    mapSettings = (MapSettings) c.getObject(0);                    game.processGameEvent(new GameSettingsChangeEvent(this));                    break;                case Packet.COMMAND_QUERY_MAP_SETTINGS :                    game.processGameEvent(new GameMapQueryEvent(this, (MapSettings)c.getObject(0)));                    break;                case Packet.COMMAND_END_OF_GAME :                    String sReport = (String) c.getObject(0);                    game.end(c.getIntValue(1), c.getIntValue(2));                    // save victory report                    saveEntityStatus(sReport);                    break;            }        }    }