public Roulette(long id) { id = this.id; Bets = new HashSet <BetPosibility>(); for (int index = 0; index <= BetPosibility.Max_Number; index++) { var index_mod_two = index % 2; var bet = new BetPosibility(BetColor._none.GetColorByIndex(index_mod_two), (index)); var result = Bets.Add(bet); } state = RouletteState.waiting; }
public Bet(BetPosibility betValue, string playerid, decimal betamount) { if (betValue.Number < BetPosibility.Min_Number || betValue.Number > BetPosibility.Max_Number) { throw new ArgumentException("The number of the Bet is invalid."); } if (string.IsNullOrEmpty(playerid)) { throw new ArgumentNullException("Player id must not be neither null nor empty"); } if (betamount < Min_amount_value || betamount > Max_amount_value) { throw new ArgumentException("The amount of the bet is invalid."); } this.BetSelected = betValue; this.PlayerId = playerid; this.BetAmount = betamount; }