コード例 #1
0
ファイル: Roulette.cs プロジェクト: archarry86/Ruleta_Api
 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;
 }
コード例 #2
0
 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;
 }