public CamelService(Guid?cupId = null, bool ignoreTime = false, int totalGames = 1000) { TotalGames = totalGames; CupId = cupId ?? Guid.NewGuid(); var seed = CupId.GetHashCode(); Runner = new CamelRunner(seed: seed, timeScalingFactor: ignoreTime ? 1000 : 1); GameIdHistory = new List <Guid>(); }
private GameResult CamelCupGameToResult(CamelCupGame game) { return(new GameResult() { RunnerSeed = CupId.GetHashCode(), StartPositionSeed = Runner.StartPositionSeed, GameSeed = Runner.GameSeed, PlayerOrderSeed = Runner.PlayerOrderSeed, History = game.History, GameId = game.GameId, EndState = game.GameState, Players = Runner.GetPlayers().ToDictionary(x => x.PlayerId, x => x.Name), Winners = game.Winners().Select(x => x.PlayerId).ToList() }); }