示例#1
0
        public Game StatusLong()
        {
            Game game = new Game();

            game.Board     = BoggleBoard.ToString();
            game.TimeLimit = TimeLimit;

            game.Player1 = Player1.ActiveLongUser();
            game.Player2 = Player2.ActiveLongUser();

            int left = (int)(StartTime.AddSeconds((double)TimeLimit) - DateTime.Now).TotalSeconds;

            if (GameState == "completed" || left <= 0)
            {
                TimeLeft     = 0;
                GameState    = "completed";
                game.Player1 = Player1.CompletedLongUser();
                game.Player2 = Player2.CompletedLongUser();
            }
            else
            {
                TimeLeft = left;
            }

            game.TimeLeft  = TimeLeft;
            game.GameState = GameState;
            return(game);
        }