예제 #1
0
 public SimpleSlotMachine(Player player,
                          IRandomSymbolGenerator randomSymbolGenerator,
                          ISymbolCoefficientProviderFactory symbolCoefficientProviderFactory)
 {
     _player = player;
     _randomSymbolGenerator            = randomSymbolGenerator;
     _symbolCoefficientProviderFactory = symbolCoefficientProviderFactory;
 }
예제 #2
0
 public SlotMachine(IRandomSymbolGenerator randomSymbolGenerator,
                    IOptions <SlotMachineSettings> slotMachineSettings,
                    ISymbolsProvider symbolsProvider)
 {
     _randomSymbolGenerator = randomSymbolGenerator;
     _symbolsProvider       = symbolsProvider;
     _reelsCount            = slotMachineSettings.Value.ReelsCount;
     _reelSymbolsCount      = slotMachineSettings.Value.ReelSymbolsCount;
     Balance = InitialBalance;
 }
        public void Setup()
        {
            _apple     = new Apple(_symbolSettingsOptions.Value.Apple);
            _pineapple = new Pineapple(_symbolSettingsOptions.Value.Pineapple);
            _banana    = new Banana(_symbolSettingsOptions.Value.Banana);
            _wildCard  = new Wildcard(_symbolSettingsOptions.Value.WildCard);

            _randomSymbolGenerator = Substitute.For <IRandomSymbolGenerator>();
            var slotMachineOptions = Substitute.For <IOptions <SlotMachineSettings> >();

            slotMachineOptions.Value.Returns(new SlotMachineSettings()
            {
                ReelSymbolsCount = 4,
                ReelsCount       = 3,
            });

            var symbolsProvider = Substitute.For <ISymbolsProvider>();

            _slotMachine = new SlotMachine(_randomSymbolGenerator,
                                           slotMachineOptions,
                                           symbolsProvider);
        }