Package megamek.common

Examples of megamek.common.MapSettings


                receiveGameOptionsAux(packet, connId);
            }
            break;
        case Packet.COMMAND_SENDING_MAP_SETTINGS:
            if ( game.getPhase().isBefore(Phase.PHASE_DEPLOYMENT)){
                MapSettings newSettings = (MapSettings) packet.getObject(0);
                if (!mapSettings.equalMapGenParameters(newSettings)) {
                    sendServerChat("Player " + player.getName() + " changed mapsettings");
                }
                mapSettings = newSettings;
                newSettings = null;
                mapSettings.replaceBoardWithRandom(MapSettings.BOARD_RANDOM);
                resetPlayersDone();
                transmitAllPlayerDones();
                send(createMapSettingsPacket());
            }
            break;
        case Packet.COMMAND_SENDING_PLANETARY_CONDITIONS:
            // MapSettings newSettings = (MapSettings) packet.getObject(0);
            if ( game.getPhase().isBefore(Phase.PHASE_DEPLOYMENT) ){
                PlanetaryConditions conditions = (PlanetaryConditions) packet.getObject(0);
                sendServerChat("Player " + player.getName() + " changed planetary conditions");
                game.setPlanetaryConditions(conditions);
                resetPlayersDone();
                transmitAllPlayerDones();
                send(createPlanetaryConditionsPacket());
            }
            break;
        case Packet.COMMAND_QUERY_MAP_SETTINGS:
            MapSettings temp = (MapSettings) packet.getObject(0);
            temp.setBoardsAvailableVector(scanForBoards(temp.getBoardWidth(), temp.getBoardHeight()));
            temp.removeUnavailable();
            temp.setNullBoards(DEFAULT_BOARD);
            temp.replaceBoardWithRandom(MapSettings.BOARD_RANDOM);
            temp.removeUnavailable();
            // if still only nulls left, use BOARD_GENERATED
            if (temp.getBoardsSelected().next() == null) {
                temp.setNullBoards((MapSettings.BOARD_GENERATED));
            }
            send(connId, createMapQueryPacket(temp));
            break;
        case Packet.COMMAND_UNLOAD_STRANDED:
            receiveUnloadStranded(packet, connId);
View Full Code Here

TOP

Related Classes of megamek.common.MapSettings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.