Ejemplo n.º 1
0
        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>();
        }
Ejemplo n.º 2
0
 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()
     });
 }