Example #1
0
        public bool SitOut(PlayerInfo p)
        {
            var oldSeat = p.NoSeat;

            if (oldSeat == -1)
            {
                return(true);
            }

            var blindNeeded = Table.Bank.DebtAmount(p);

            if (!Table.Zombies.Contains(p))
            {
                Table.Zombies.Add(p);
            }
            if (State == GameStateEnum.Playing && Table.Seats.CurrentPlayer() == p)
            {
                PlayMoney(p, -1);
            }
            else if (blindNeeded > 0)
            {
                PlayMoney(p, blindNeeded);
            }

            if (Table.Seats.Players().ContainsPlayerWithSameName(p))
            {
                Table.SitOut(p);
                var seat = new SeatInfo()
                {
                    Player = null,
                    NoSeat = oldSeat,
                };
                Observer.RaiseSeatUpdated(seat);
                m_CurrentModule?.OnSitOut();
                return(true);
            }
            return(false);
        }