Ejemplo n.º 1
0
        public override void Execute(InRoomChat irc, string[] args)
        {
            if (args.Length > 0)
            {
                Gamemode oldMode = Mod.Gamemodes.CurrentMode;
                Gamemode newMode = Mod.Gamemodes.Find(args[0]);
                if (newMode == null)
                {
                    return;
                }

                GameHelper.Broadcast($"Gamemode Switch ({oldMode.Name} -> {newMode.Name})!");

                newMode.OnReset();
                Mod.Gamemodes.CurrentMode = newMode;

                oldMode.CleanUp();
            }
            else
            {
                irc.AddLine("Available Gamemodes:".AsColor("AAFF00"));

                foreach (Gamemode mode in Mod.Gamemodes.Elements)
                {
                    irc.AddLine("> ".AsColor("00FF00").AsBold() + mode.Name);
                }
            }
        }