public void FromXml(XmlNode node)
        {
            TournPlayer tournPlayer1 = new TournPlayer();

            foreach (XmlNode selectNode in node.SelectNodes(tournPlayer1.XmlKeyElementName))
            {
                TournPlayer tournPlayer2 = new TournPlayer();
                tournPlayer2.FromXml(selectNode);
                this.AddPlayer((ITournPlayer)tournPlayer2);
            }
        }
Example #2
0
 public TournPlayer(TournPlayer player)
     : base(player.FirstName, player.LastName, player.ID)
 {
     this._dropRound         = player.DropRound;
     this._matchCount        = player.MatchCount;
     this._playoffPoints     = player.PlayoffPoints;
     this._tie1              = player._tie1;
     this._tie2              = player._tie2;
     this._tie3              = player._tie3;
     this._tie4              = player._tie4;
     this._openDuelingPoints = player._openDuelingPoints;
 }
        public void AssignRanks(int maxRound, bool IncludeDrops)
        {
            int         num1         = 1;
            int         num2         = 1;
            TournPlayer tournPlayer1 = (TournPlayer)null;

            this.SortByRank();
            foreach (TournPlayer tournPlayer2 in (List <ITournPlayer>) this)
            {
                bool flag = tournPlayer2.IsActive;
                if (tournPlayer2.DropRound > maxRound)
                {
                    flag = true;
                }
                if (tournPlayer2.DropRound == maxRound && tournPlayer2.DropReason == CutType.PlayoffCut)
                {
                    flag = true;
                }
                if (tournPlayer2.DropRound == maxRound && tournPlayer2.DropReason == CutType.TopX)
                {
                    flag = true;
                }
                if (IncludeDrops)
                {
                    flag = true;
                }
                if (flag)
                {
                    if (tournPlayer1 == null || tournPlayer1.CompareRank((ITournPlayer)tournPlayer2) != 0)
                    {
                        num2 = num1;
                    }
                    tournPlayer2.Rank = num2;
                    ++num1;
                    tournPlayer1 = tournPlayer2;
                }
                else
                {
                    tournPlayer2.Rank = this.Count + 1;
                }
            }
        }