fCraft.DevCommands.GameHandler C# (CSharp) Method

GameHandler() private static method

private static GameHandler ( Player player, Command cmd ) : void
player Player
cmd Command
return void
        private static void GameHandler( Player player, Command cmd )
        {
            string GameMode = cmd.Next();
            string Option = cmd.Next();
            World world = player.World;
            /*if (world == WorldManager.MainWorld){
                player.Message("/Game cannot be used on the main world");
                return;
            }*/

            if ( GameMode.ToLower() == "zombie" ) {
                if ( Option.ToLower() == "start" ) {
                    ZombieGame game = new ZombieGame( player.World ); //move to world
                    game.Start();
                    return;
                } else {
                    CdGame.PrintUsage( player );
                    return;
                }
            }
            if ( GameMode.ToLower() == "minefield" ) {
                switch (Option.ToLower())
                {
                    case "start":
                        if ( WorldManager.FindWorldExact( "Minefield" ) != null ) {
                            player.Message( "&WA game of Minefield is currently running and must first be stopped" );
                            return;
                        }
                        MineField.GetInstance();
                        MineField.Start( player );
                        return;
                    case "stop":
                        if ( WorldManager.FindWorldExact( "Minefield" ) == null ) {
                            player.Message( "&WA game of Minefield is currently not running" );
                            return;
                        }
                        MineField.Stop( player, false );
                        return;
                    default:
                        CdGame.PrintUsage( player );
                        return;
                }
            } else {
                CdGame.PrintUsage( player );
                return;
            }
        }