Exemple #1
0
        public GameRoomXML(GameRoom g)
        {
            Id      = g.Id;
            Players = new List <PlayerXML>();
            foreach (Player p in g.GetPlayersInRoom())
            {
                Players.Add(new PlayerXML(p));
            }

            Spectatores = new List <SpecXML>();
            foreach (Spectetor p in g.GetSpectetorInRoom())
            {
                Spectatores.Add(new SpecXML(p));
            }

            DealerPos     = g.GetDealerPos();
            maxBetInRound = g.GetMaxBetInRound();
            PotCount      = g.GetPotSize();
            Bb            = g.getBBnum();
            Sb            = g.getSBNUM();
            Deck          = g.GetDeck();
            Hand_Step     = g.GetHandStep();
            PublicCards   = g.GetPublicCards();
            IsActiveGame  = g.IsGameActive();
            if (g.GetSidePots() != null)
            {
                sidePotsXML = new List <SidePotTuple>();
                SidePots    = new List <Tuple <int, PlayerXML> >();
                foreach (var p in g.GetSidePots())
                {
                    PlayerXML pp = new PlayerXML(p.Item2);
                    SidePots.Add(new Tuple <int, PlayerXML>(p.Item1, pp));
                    sidePotsXML.Add(new SidePotTuple(p.Item1, pp));
                }
            }

            GameReplay    = g.GetGameRepObj();
            league        = g.GetLeagueName();
            ReplayManager = g.GetRepManager();

            CurrentPlayer = new PlayerXML(g.GetCurrPlayer());
            DealerPlayer  = new PlayerXML(g.GetDealer());
            BbPlayer      = new PlayerXML(g.GetBb());
            SbPlayer      = new PlayerXML(g.GetSb());
            //  MyDecorator = g.GetDecorator();

            GameNumber                 = g.GetGameNum();
            FirstPlayerInRound         = new PlayerXML(g.GetFirstPlayerInRound());
            currentPlayerPos           = g.GetCurrPosition();
            firstPlayerInRoundPoistion = g.GetFirstPlayerInRoundPos();
            lastRaiseInRound           = g.GetlastRaiseInRound();
            useCommunication           = g.GetUseComm();
        }
Exemple #2
0
        private Player GetPlayerFromXML(PlayerXML p, GameCenter gc)
        {
            Player toRet = new Player(p.name, p.TotalChip, p.roomId, p.RoundChipBet, p.isPlayerActive, p._firstCard,
                                      p._secondCard, p.PlayedAnActionInTheRound, p._publicCards);

            toRet.user = gc.GetSysControl().GetUserWithId(p.userId);
            if (toRet.user == null)
            {
                return(null);
            }
            return(toRet);
        }
Exemple #3
0
 public SidePotTuple(int a, PlayerXML b)
 {
     item1 = a;
     item2 = b;
 }