예제 #1
0
        public static void ForceStart(Message msg, string[] args)
        {
            SixNimmt game = Bot.GetGameByChatId(msg.Chat.Id);

            if (game == null)
            {
                return;
            }
            else
            {
                game.HandleMessage(msg);
            }
        }
예제 #2
0
        public static void RemoveVirtualPlayer(Message msg, string[] args)
        {
            SixNimmt game = Bot.GetGameByChatId(msg.Chat.Id);

            if (game == null)
            {
                return;
            }
            else
            {
                game.HandleMessage(msg);
            }
        }
예제 #3
0
        public static void KillGame(Message msg, string[] args)
        {
            SixNimmt game = Bot.GetGameByChatId(msg.Chat.Id);

            if (game == null)
            {
                return;
            }
            else
            {
                game.HandleMessage(msg);
                // Bot.RemoveGame(game);
                game.Dispose();
                game = null;
            }
        }
예제 #4
0
        public static void StartGame(Message msg, string[] args)
        {
            SixNimmt game = Bot.GetGameByChatId(msg.Chat.Id);

            if (game == null)
            {
                if (Program.MaintMode)
                {
                    Bot.Send(msg.Chat.Id, GetTranslation("CantStartGameMaintenance", GetLanguage(msg.Chat.Id)));
                    return;
                }


                Bot.AddGame(new SixNimmt(msg.Chat.Id, msg.From, msg.Chat.Title, msg.Chat.Username));
            }
            else
            {
                game.HandleMessage(msg);
                // msg.Reply(GetTranslation("ExistingGame", GetLanguage(msg.Chat.Id)));
            }
        }
예제 #5
0
 public static void RemoveGame(SixNimmt game)
 {
     Program.Games.Remove(game);
 }
예제 #6
0
 public static void AddGame(SixNimmt game)
 {
     Program.Games.Add(game);
 }