コード例 #1
0
        /// <summary>
        /// Returns last rank
        /// </summary>
        /// <returns></returns>
        public static LeadershipRank GetLast()
        {
            LeadershipRank result = LeadershipRank.RankList.FirstOrDefault(x => !x.NextRankId.HasValue || x.NextRankId.Value == -1);

            if (result != null && result.Status != UniversalStatus.Active)
            {
                result = result.GetPrev();
            }

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Returns previously Active rank
        /// </summary>
        /// <returns></returns>
        public LeadershipRank GetPrev()
        {
            LeadershipRank result = null;

            if (this.PrevRankId.HasValue && this.PrevRankId.Value != -1)
            {
                result = new LeadershipRank(this.PrevRankId.Value);
                if (result.Status != UniversalStatus.Active)
                {
                    result = result.GetPrev();
                }
            }

            return(result);
        }