public static CompetitionRunner CreateRunner(CompetitionConfiguration configuration) { if (configuration == null || !configuration.IsCorrect()) { return(null); } return(new CompetitionRunner(configuration)); }
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 }; }