private void ComputeGame(CancellationToken cancelToken) { while (!cancelToken.IsCancellationRequested) { var game = Runner.ComputeNewGame(); SetLastGame(game); GameIdHistory.Add(game.GameId); GamesPlayed++; if (GamesHasWinner()) { break; } } }
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); }