Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void SetBlinds()
- {
- /* Set players as dealer, small and big blinds in that order, last player is dealer - first player is small, etc */
- GamePlayData.BlindStart = 0;
- if (GamePlayData.Players.Count == 2)
- {
- /* This is easy enough */
- for (var i = 0; i <= 1; i++)
- {
- GamePlayData.Players[i].IsDealer = GamePlayData.BlindStart == i;
- GamePlayData.Players[i].Blind = GamePlayData.BlindStart == 0 ? Blinds.Big : Blinds.Small;
- }
- return;
- }
- var nextBlind = GamePlayData.BlindStart;
- GamePlayData.Players[nextBlind].IsDealer = true;
- for (var i = 0; i <= 1; i++)
- {
- nextBlind++;
- if (nextBlind > GamePlayData.Players.Count - 1)
- {
- nextBlind = 0;
- }
- GamePlayData.Players[nextBlind].Blind = i == 0 ? Blinds.Small : Blinds.Big;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement