Ejemplo n.º 1
0
        public int GetRankIndex(GroupRank rank)
        {
            for (int i = 1; i <= this.ranks.Count; i++)
            {
                if (this.ranks[i].Equals(rank))
                {
                    return(i);
                }
            }

            throw new Exception("Rank not found.");
        }
Ejemplo n.º 2
0
        public void DeleteRank(int rankIndex)
        {
            GroupRank rank = this.GetRank(rankIndex);
            GroupRank replacementRank;

            if (rankIndex.Equals(this.ranks.Count))
            {
                replacementRank = this.ranks[rankIndex - 1];
            }
            else
            {
                replacementRank = this.ranks[rankIndex + 1];
            }

            //this.members.Where(m => m.RankGuid.Equals(rank.Guid)).ForEach(m => m.RankGuid = replacementRank.Guid); // Commented out to to cslua issue

            this.ranks.Remove(rank);
        }
Ejemplo n.º 3
0
 public void SetRank(int i, GroupRank rank)
 {
     this.ranks[i] = rank;
 }
Ejemplo n.º 4
0
        public void AddRank(string rankName)
        {
            var rank = new GroupRank(rankName, this.ranks.Count == 0);

            this.ranks.Add(rank);
        }