resetEntityPhase(phase);
    private void prepareForPhase(int phase) {        switch (phase) {            case Game.PHASE_LOUNGE :                mapSettings.setBoardsAvailableVector(scanForBoards(mapSettings.getBoardWidth(), mapSettings.getBoardHeight()));                mapSettings.setNullBoards(DEFAULT_BOARD);                send(createMapSettingsPacket());                break;            case Game.PHASE_INITIATIVE :                // remove the last traces of last round                game.resetActions();                game.resetRoundReport();                roundReport = game.getRoundReport(); //HACK                resetEntityRound();                resetEntityPhase(phase);                checkForObservers();                // roll 'em                resetActivePlayersDone();                rollInitiative();                if ( !game.shouldDeployThisRound() )                  incrementAndSendGameRound();                //setIneligible(phase);                determineTurnOrder(phase);                writeInitiativeReport(false);                send(createReportPacket());                autoSave();                System.out.println("Round " + game.getRoundCount() + " memory usage: " + MegaMek.getMemoryUsed());                break;            case Game.PHASE_DEPLOY_MINEFIELDS :                checkForObservers();                resetActivePlayersDone();                setIneligible(phase);                Enumeration e = game.getPlayers();                Vector turns = new Vector();                while (e.hasMoreElements()) {                    Player p = (Player) e.nextElement();                    if (p.hasMinefields()) {                        GameTurn gt = new GameTurn(p.getId());                        turns.addElement(gt);                    }                }                game.setTurnVector(turns);                game.resetTurnIndex();                // send turns to all players                send(createTurnVectorPacket());                break;            case Game.PHASE_SET_ARTYAUTOHITHEXES :                // place off board entities actually off-board                Enumeration i = game.getEntities();                while (i.hasMoreElements()) {                    Entity en = (Entity) i.nextElement();                    en.deployOffBoard();                }                checkForObservers();                resetActivePlayersDone();                setIneligible(phase);                i = game.getPlayers();                Vector turn = new Vector();                // Walk through the players of the game, and add                // a turn for all players with artillery weapons.                while (i.hasMoreElements()) {                    // Get the next player.                    final Player p = (Player) i.nextElement();                    // Does the player have any artillery-equipped units?                    EntitySelector playerArtySelector = new EntitySelector() {                            private Player owner = p;                            public boolean accept (Entity entity) {                                if ( owner.equals( entity.getOwner() ) &&                                     isEligibleForTargetingPhase( entity ) )                                    return true;                                return false;                            }                        };                    if ( game.getSelectedEntities( playerArtySelector )                         .hasMoreElements() ) {                        // Yes, the player has arty-equipped units.                        GameTurn gt = new GameTurn(p.getId());                        turn.addElement(gt);                    }                }                game.setTurnVector(turn);                game.resetTurnIndex();                // send turns to all players                send(createTurnVectorPacket());                break;            case Game.PHASE_MOVEMENT :                roundReport.append("\nMovement Phase\n-------------------\n");            case Game.PHASE_DEPLOYMENT :            case Game.PHASE_FIRING :            case Game.PHASE_PHYSICAL :            case Game.PHASE_TARGETING:            case Game.PHASE_OFFBOARD:                resetEntityPhase(phase);                checkForObservers();                setIneligible(phase);                determineTurnOrder(phase);                resetActivePlayersDone();                //send(createEntitiesPacket());                entityAllUpdate();                game.resetPhaseReport();                phaseReport = game.getPhaseReport(); //HACK                break;            case Game.PHASE_END :                game.resetPhaseReport();                phaseReport = game.getPhaseReport(); //HACK                resolveHeat();                phaseReport.append("\n\nEnd Phase\n------------------------\n");                checkForSuffocation();                resolveFire();                resolveExtremeTempInfantryDeath();                resolveAmmoDumps();                resolveCrewDamage();                resolveCrewWakeUp();                resetEntityPhase(phase);                checkForObservers();                if (phaseReport.length() > 0) {                    roundReport.append(phaseReport.toString());                }                log.append( "\n" );                log.append( roundReport.toString() );            case Game.PHASE_MOVEMENT_REPORT :            case Game.PHASE_FIRING_REPORT :            case Game.PHASE_OFFBOARD_REPORT :                resetActivePlayersDone();                send(createReportPacket());                if (game.getOptions().booleanOption("paranoid_autosave")) autoSave();                break;            case Game.PHASE_VICTORY :                prepareVictoryReport();                log.append( "\n" );                log.append( roundReport.toString() );                send(createFullEntitiesPacket());                send(createReportPacket());                send(createEndOfGamePacket());                break;        }    }