public void Collect(Player player) { if (player.IsActive || (!player.IsActive && !player.IsFold)) { FoldCount += player.IsFold ? 1 : 0; CallCount += player.Action == PlayerAction.Call ? 1 : 0; CheckCount += player.Action == PlayerAction.Check ? 1 : 0; RaiseCount += (player.Action == PlayerAction.Raise || (!player.IsActive && !player.IsFold)) ? 1 : 0; TotalCount += 1; } }
public Table(int playerCount, AppSettings settings) { TotalRounds = 0; ButtonPlayerPrev = -999; _random = new Random(); ShortButton1 = settings.ShortButtonRect1; ShortButton2 = settings.ShortButtonRect2; ShortButton3 = settings.ShortButtonRect3; ShortButton4 = settings.ShortButtonRect4; CardSuitRect = settings.CardSuitRect; CardRankRect = settings.CardRankRect; CardMinSize = (int)settings.MinCardSize; BetCounterPreFlop = 1; BetCounterFlop = 1; BetCounterTurn = 1; BetCounterRiver = 1; RaiseCounter = 0; PlayerActionCounter = 0; PlayerRects = new List<Rectangle>(); PlayerFolds = new List<Rectangle>(); ButtonRects = new List<Rectangle>(); BetRects = new List<Rectangle>(); Players = new PlayerCollection(); DealerButtons = new List<bool>(); PlayerBets = new List<PlayerBet>(); MyBalance = new Player(); Bank = new Bank(); for (int i = 0; i < playerCount; i++) { Players.Add(new Player {Action = PlayerAction.Init}); } for (int i = 0; i < playerCount; i++) { DealerButtons.Add(false); } for (int i = 0; i < playerCount; i++) { PlayerBets.Add(new PlayerBet()); } _cardRecognizer = new CardRecognizer(); }