Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1.         private static void SetBlinds()
  2.         {
  3.             /* Set players as dealer, small and big blinds in that order, last player is dealer - first player is small, etc */
  4.             GamePlayData.BlindStart = 0;
  5.             if (GamePlayData.Players.Count == 2)
  6.             {
  7.                 /* This is easy enough */
  8.                 for (var i = 0; i <= 1; i++)
  9.                 {
  10.                     GamePlayData.Players[i].IsDealer = GamePlayData.BlindStart == i;
  11.                     GamePlayData.Players[i].Blind = GamePlayData.BlindStart == 0 ? Blinds.Big : Blinds.Small;
  12.                 }
  13.                 return;
  14.             }
  15.             var nextBlind = GamePlayData.BlindStart;
  16.             GamePlayData.Players[nextBlind].IsDealer = true;
  17.             for (var i = 0; i <= 1; i++)
  18.             {
  19.                 nextBlind++;
  20.                 if (nextBlind > GamePlayData.Players.Count - 1)
  21.                 {
  22.                     nextBlind = 0;
  23.                 }
  24.                 GamePlayData.Players[nextBlind].Blind = i == 0 ? Blinds.Small : Blinds.Big;
  25.             }
  26.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement