예제 #1
0
        public static JGPartyTable CreateTable(int Mise, JGGameTablePlayerProfile human, params JGGameTablePlayerProfile[] players)
        {
            if (Mise <= 0)
            {
                return(null);
            }
            if ((human == null) || (players == null) || (players.Length <= 0))
            {
                return(null);
            }

            var t = from s in players where (s != null) select s.Player;

            JGPlayer[] tp = t.ToArray();

            ArrayList st = new ArrayList();

            st.Add(human);
            st.AddRange(players);
            int v_pot = 0;

            foreach (JGGameTablePlayerProfile item in st)
            {
                if (!item.RemoveFromBalance(Mise))
                {
                    //party.EjectPlayer(item.Player, enuEjectReason.CanRemoveBalance);

                    return(null);
                }
                else
                {
                    v_pot += Mise;
                }
            }



            JGParty party = JGParty.CreateParty(human.Player, tp);

            if (party == null)
            {
                return(null);
            }



            JGPartyTable p = new JGPartyTable();

            //p.Register(human, players);
            p.m_party           = party;
            p.m_party.PartyEnd += p.m_party_PartyBetEnd;
            p.m_profiles        = (JGGameTablePlayerProfile[])st.ToArray(typeof(JGGameTablePlayerProfile));
            p.m_Pot             = v_pot;
            return(p);
        }
예제 #2
0
        public void Register(JGHumanPlayer human, params JGPlayer[] players)
        {
            JGParty p = JGParty.CreateParty(human, players);

            this.m_party = p;
        }