예제 #1
0
        public bool Fold(string name)
        {
            var player = GetPlayer(name);

            VerifyIsPlayersTurn(player);
            BetQueue.RemoveFirst();
            player.Folded  = true;
            player.Hand[0] = null;
            player.Hand[1] = null;
            Pots.ForEach(x => x.RemovePlayer(player));

            if (GetPlayersStillInGame().Count() == 1)
            {
                BetQueue.Clear();
                State = State.DeterminingWinner;
                NextStage();
                return(false);
            }
            else
            {
                if (BetQueue.Count == 0)
                {
                    NextStage();
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
        }
예제 #2
0
        public bool ShowCards(string name)
        {
            var player = GetPlayer(name);

            VerifyIsPlayersTurn(player);
            BetQueue.RemoveFirst();
            Pots.ForEach(x => x.RemovePlayer(player));
            ShowPlayerCards.Add(player);
            if (BetQueue.Count == 0)
            {
                NextStage();
                return(false);
            }
            else
            {
                return(true);
            }
        }
예제 #3
0
        public bool HideCards(string name)
        {
            var player = GetPlayer(name);

            VerifyIsPlayersTurn(player);
            BetQueue.RemoveFirst();
            player.Hand[0] = null;
            player.Hand[1] = null;
            Pots.ForEach(x => x.RemovePlayer(player));
            if (BetQueue.Count == 0)
            {
                NextStage();
                return(false);
            }
            else
            {
                return(true);
            }
        }