Пример #1
0
        private static GameInitializer BuildGameInitializer(IPlayersFactory playersFactory = null, IPatternFactory patternFactory = null, IIntelligenceFactory aiFactory = null)
        {
            var io = new MockInputOutput();

            playersFactory = playersFactory ?? new PlayersFactory(new HumanIntelligence(io));
            patternFactory = patternFactory ?? new PatternFactory();
            aiFactory      = aiFactory ?? new IntelligenceFactory(io);
            return(new GameInitializer(playersFactory, patternFactory, aiFactory));
        }
Пример #2
0
        private static GameInitializer BuildGameInitializer(IPlayersFactory playersFactory = null, IPatternFactory patternFactory = null, IIntelligenceFactory aiFactory = null)
        {
            var player1 = new MockPlayer();
            var player2 = new MockPlayer();

            playersFactory = playersFactory ?? new MockPlayersFactory().CreateStubbedToReturn(new List <IPlayer> {
                player1, player2
            });;
            patternFactory = patternFactory ?? new MockPatternFactory();
            aiFactory      = aiFactory ?? new MockIntelligenceFactory();
            return(new GameInitializer(playersFactory, patternFactory, aiFactory));
        }
Пример #3
0
 public GameInitializer(IPlayersFactory playersFactory, IPatternFactory patternFactory, IIntelligenceFactory aiFactory)
 {
     _playersFactory = playersFactory;
     _patternFactory = patternFactory;
     _aiFactory      = aiFactory;
 }