Ejemplo n.º 1
0
        public int InitialWinnings(Enums.WheelSymbol symbol, int count)
        {
            if (symbol == Enums.WheelSymbol.Bell && count == 3)
            {
                return(100);
            }
            if (symbol == Enums.WheelSymbol.Cherry && count == 3)
            {
                return(10);
            }
            if (symbol == Enums.WheelSymbol.Clover && count == 3)
            {
                return(1);
            }
            if (symbol == Enums.WheelSymbol.Bell && count == 2)
            {
                return(5);
            }
            if (symbol == Enums.WheelSymbol.Cherry && count == 2)
            {
                return(1);
            }

            return(0);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Retrieve the winning amount for an outcome containing the
        /// specified number of the specified symbol.
        /// </summary>
        public int GetWinnings(Enums.WheelSymbol symbol, int count)
        {
            WheelSymbolCount entry = new WheelSymbolCount(symbol, count);

            if (!_winningsSettings.ContainsKey(entry))
            {
                return(0);
            }

            return(_winningsSettings[entry]);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create object based on a symbol/count pair
        /// </summary>
        public WheelSymbolList(Enums.WheelSymbol symbol, int count)
        {
            if (count < 0)
            {
                throw new ArgumentException(nameof(WheelSymbolList));
            }

            _symbols = new List <Enums.WheelSymbol>();
            for (int i = 0; i < count; i++)
            {
                _symbols.Add(symbol);
            }
        }
Ejemplo n.º 4
0
        public int InitialProbability(Enums.WheelSymbol symbol)
        {
            if (symbol == Enums.WheelSymbol.Bell)
            {
                return(10);
            }
            if (symbol == Enums.WheelSymbol.Cherry)
            {
                return(30);
            }
            if (symbol == Enums.WheelSymbol.Clover)
            {
                return(60);
            }

            return(0);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Set the winning amount for an outcome containing the
        /// specified number of the specified symbol.
        /// </summary>
        public void SetWinnings(Enums.WheelSymbol symbol, int count, int winAmount)
        {
            if (count < 1 || winAmount < 0)
            {
                throw new ArgumentException(nameof(SetWinnings));
            }

            WheelSymbolCount entry = new WheelSymbolCount(symbol, count);

            if (!_winningsSettings.ContainsKey(entry))
            {
                _winningsSettings.Add(entry, winAmount);
            }
            else
            {
                _winningsSettings[entry] = winAmount;
            }

            OnPropertyChanged(nameof(WinningsSettings));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Retrieves the number of wheel symbols equal to the given symbol
 /// </summary>
 public int NumberOf(Enums.WheelSymbol symbol)
 {
     return(_symbols.FindAll((wheelSymbol => wheelSymbol == symbol)).Count);
 }
Ejemplo n.º 7
0
 public WheelSymbolCount(Enums.WheelSymbol symbol, int count)
 {
     _symbol = symbol;
     _count  = count;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Inserts a new value into the cache.
 /// </summary>
 private void CacheInsert(int percent, Enums.WheelSymbol symbol)
 {
     _cache[percent] = symbol;
 }