Beispiel #1
0
 private void Bet(PlayerWithCard bettor, int chipAmount)
 {
     bettor.Player.DeductChips(chipAmount);
     _pot += chipAmount;
 }
Beispiel #2
0
 private void Wins(PlayerWithCard winner)
 {
     winner.Player.ReceiveChips(_pot);
 }
Beispiel #3
0
 public string Act(PlayerWithCard opponent)
 {
     var action = _player.GetAction();
     opponent.Player.OpponentsAction(action);
     return action;
 }
Beispiel #4
0
 private void SwitchToAct()
 {
     var temp = _actNext;
     _actNext = _actAfter;
     _actAfter = temp;
 }
Beispiel #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);
     }
 }
Beispiel #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);
        }
Beispiel #7
0
 private void PostBlinds(PlayerWithCard blind, PlayerWithCard button)
 {
     blind.Player.PostBlind();
     button.Player.SendButton();
     Bet(blind, 1);
 }
Beispiel #8
0
 private void Loses(PlayerWithCard loser)
 {
     loser.Player.ReceiveChips(0);
 }