예제 #1
0
        private void ComputeGame(CancellationToken cancelToken)
        {
            while (!cancelToken.IsCancellationRequested)
            {
                var game = Runner.ComputeNewGame();
                SetLastGame(game);
                GameIdHistory.Add(game.GameId);
                GamesPlayed++;

                if (GamesHasWinner())
                {
                    break;
                }
            }
        }
예제 #2
0
        public GameResult GetGame(int?startPosSeed, int?playerSeed, int?gameSeed)
        {
            CamelCupGame game;

            if (startPosSeed.HasValue && playerSeed.HasValue && gameSeed.HasValue)
            {
                game = Runner.ComputeSeededGame(startPosSeed.Value, playerSeed.Value, gameSeed.Value);
            }
            else
            {
                game = Runner.ComputeNewGame();
            }
            GameIdHistory.Add(game.GameId);
            SetLastGame(game);
            return(LastGameResult);
        }