public override bool PlaceBetAndPlay(Roulette game) { if (Balance == 0) { return(false); } if (IsLastWon) { LastColor = LastColor == BetColorType.Black ? BetColorType.Red : BetColorType.Black; LastBetValue = BaseBetValue; Int64 betValue = Balance >= LastBetValue ? LastBetValue : Balance; ColorRouletteBet bet = new(betValue); bet.SetColor(LastColor); Int64 betResult = game.Play(bet); Balance += betResult; IsLastWon = betResult > 0; } else { LastBetValue = Balance >= LastBetValue * 2 ? LastBetValue * 2 : Balance; ColorRouletteBet bet = new(LastBetValue); bet.SetColor(LastColor); Int64 betResult = game.Play(bet); Balance += betResult; IsLastWon = betResult > 0; } return(true); }
public void SetColor(BetColorType color) { if (Enum.IsDefined(typeof(BetColorType), color)) { Color = color; } else { throw new ArgumentException("Invalid color argument"); } }
public MartingaleBotPlayer(Int64 money) : base(money) { LastBetValue = BaseBetValue; IsLastWon = true; LastColor = (BetColorType) new Random().NextInt64(0, 1); }