Ejemplo n.º 1
0
        public WinResponse Spin(Cash bet)
        {
            if (bet.Count > Cash.Count)
            {
                throw new NotEnoughMoneyException();
            }
            if (bet.Count < MinAwaibleBet.Count || bet.Count > MaxAwaibleBet.Count)
            {
                throw new NotAwaibleBetException();
            }

            Cash.Count -= bet.Count;
            GameField.GenerateSigns();

            var winValidator = WinValidators.CheckWin(GameField);

            Cash.Count += bet.Count * winValidator.Multiplier;


            var winResponse = new WinResponse(winValidator.Name, bet, winValidator.Multiplier);

            HistoryOfSpins.Add(winResponse);
            return(winResponse);
        }
Ejemplo n.º 2
0
 public bool Equals(WinResponse response)
 {
     return(response.Name == this.Name && response.Multiplier == this.Multiplier);
 }