Пример #1
0
 private void Bet(PlayerWithCard bettor, int chipAmount)
 {
     bettor.Player.DeductChips(chipAmount);
     _pot += chipAmount;
 }
Пример #2
0
 private void Wins(PlayerWithCard winner)
 {
     winner.Player.ReceiveChips(_pot);
 }
Пример #3
0
 public string Act(PlayerWithCard opponent)
 {
     var action = _player.GetAction();
     opponent.Player.OpponentsAction(action);
     return action;
 }
Пример #4
0
 private void SwitchToAct()
 {
     var temp = _actNext;
     _actNext = _actAfter;
     _actAfter = temp;
 }
Пример #5
0
 private void ShowDown(PlayerWithCard p1, PlayerWithCard p2)
 {
     if (Card.Rank(p1.Card) > Card.Rank(p2.Card)) {
         Wins(p1);
         Loses(p2);
     }
     else {
         Wins(p2);
         Loses(p1);
     }
 }
Пример #6
0
        private void SetUpHand(IManagePlayersStack blind, IManagePlayersStack button, IRandomiseCards deck)
        {
            _actAfter = new PlayerWithCard(blind, deck.Next());
            _actNext = new PlayerWithCard(button, deck.Next());

            PostBlinds(_actAfter, _actNext);
        }
Пример #7
0
 private void PostBlinds(PlayerWithCard blind, PlayerWithCard button)
 {
     blind.Player.PostBlind();
     button.Player.SendButton();
     Bet(blind, 1);
 }
Пример #8
0
 private void Loses(PlayerWithCard loser)
 {
     loser.Player.ReceiveChips(0);
 }