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