Ejemplo n.º 1
0
        public static CompetitionRunner CreateRunner(CompetitionConfiguration configuration)
        {
            if (configuration == null || !configuration.IsCorrect())
            {
                return(null);
            }

            return(new CompetitionRunner(configuration));
        }
Ejemplo n.º 2
0
        private CompetitionRunner(CompetitionConfiguration configuration)
        {
            _firstBotKind     = configuration.FirstBotKind;
            _secondBotKind    = configuration.SecondBotKind;
            _width            = configuration.Width;
            _height           = configuration.Height;
            _botTurnLength    = configuration.BotTurnLength;
            _concurrencyLevel = configuration.ConcurrencyLevel;
            _runCount         = configuration.RunCount;

            _firstPlayerXDistribution = new WinLossDistribution {
                Total = _runCount
            };
            _firstPlayerODistribution = new WinLossDistribution {
                Total = _runCount
            };
        }