コード例 #1
0
    public RouletteBet(double betAmount, BetType type, int[] surrNum)
    {
        _betAmount          = betAmount;
        _type               = type;
        _surroundingNumbers = surrNum;



        if (_user.balance() < _betAmount)
        {
            Console.WriteLine($"You don't have enough funds to do the ${_betAmount} bet. - {_type.ToString()}");
            return;
        }

        SplashKit.PlaySoundEffect(new SoundEffect("PlaceBet", "PlaceBet.mp3"));

        _rouletteRoll = new RouletteRoll();
        _roll         = _rouletteRoll.GetRoll();

        _user.BalanceAdjust(false, _betAmount);
        Console.Write($"You have placed a ${betAmount} on {type.ToString().ToLower()}, you need ");
        for (int x = 0; x < surrNum.Length; x++)
        {
            if (surrNum.Length > 1 && surrNum.Length != (x + 1))
            {
                Console.Write(surrNum[x] + ", ");
            }
            else
            {
                Console.Write(surrNum[x] + " ");
            }
        }

        Console.Write("to win...\n");

        Console.WriteLine($"The roll is... {_roll}.");

        HandleBet(type);
    }