예제 #1
0
        public ModelAutoPlay(
            ILogicCalculateWinnings logicCalculateWinnings,
            ILogicSymbolGenerator logicSymbolGenerator,
            int noOfRunsInAutoPlay,
            int updateThreshold)
        {
            CurrentAutoPlayState = Enums.AutoPlayState.BeforeFirstInteraction;
            NoOfRuns             = noOfRunsInAutoPlay;
            PercentCompleted     = 0;
            PercentPayback       = 100;
            _updateThreshold     = updateThreshold;
            _autoRunData         = new Dictionary <int, int>();
            _symbols             = new WheelSymbolList();

            _autoCommand = new AutoPlayControllerCommand(this);

            _logicCalculateWinnings = logicCalculateWinnings;
            _logicSymbolGenerator   = logicSymbolGenerator;

            _progressHandler         = new Progress <int>(i => { OnPropertyChanged(nameof(PercentCompleted)); });
            _cancellationTokenSource = null;
        }
예제 #2
0
        public ModelNormalPlay(
            ILogicCalculateWinnings logicCalculateWinnings,
            ILogicSymbolGenerator logicSymbolGenerator,
            int initialCredits,
            int noOfRotationsPerSpin,
            int rotationDelayMilliSecs) : base(new List <IPropertySource>())
        {
            _noOfRotationsPerSpin   = noOfRotationsPerSpin;
            _rotationDelayMilliSecs = rotationDelayMilliSecs;

            _noOfCredits           = initialCredits;
            _symbols               = new WheelSymbolList();
            CurrentNormalPlayState = Enums.NormalPlayState.BeforeFirstInteraction;

            _spinCommand      = new SpinControllerCommand(this);
            _addCreditCommand = new AddCreditsControllerCommand(this);

            _logicCalculateWinnings = logicCalculateWinnings;
            _logicSymbolGenerator   = logicSymbolGenerator;

            AddCommandDependency(nameof(IModelNormalPlay.CurrentNormalPlayState), _spinCommand);
            AddCommandDependency(nameof(IModelNormalPlay.CurrentNormalPlayState), _addCreditCommand);
        }