Esempio n. 1
0
        void handleConsoleActions(List <ConsoleAction> actions)
        {
            foreach (ConsoleAction action in actions)
            {
                switch (action.type)
                {
                case ConsoleActions.regenIsland:
                    world.setupIslandManager();
                    break;

                case ConsoleActions.setPlayerSpeed:
                    Player.floatingCameraSpeed = ((SetPlayerSpeedConsoleAction)action).speed;
                    break;

                case ConsoleActions.placeIsland:
                    world.placeIsland(new IntVector3(player.getCameraLoc()).toVector3());
                    break;

                case ConsoleActions.mipIsland:
                    world.getIslandManager().mipIslandToLevel(world.getIslandManager().getClosestIslandToLocation(player.getCameraLoc()),
                                                              ((mipIslandConsoleAction)action).mipLevel);
                    break;

                case ConsoleActions.addNewCharacter:
                    world.addCharacterAt(player.getCameraLoc(), Actor.Faction.friendly);
                    break;

                case ConsoleActions.addNewEnemy:
                    world.addCharacterAt(player.getCameraLoc(), Actor.Faction.enemy);
                    break;

                case ConsoleActions.addNewBoat:
                    world.addBoatAt(player.getCameraLoc());
                    break;

                default:
                    throw new Exception("unhandled console action");
                }
            }
        }