예제 #1
0
파일: Group.cs 프로젝트: Yarpii/MTGRP
        public bool TryGetRank(Character member, out GroupRank rank)
        {
            GroupDivision div = Divisions.Find(x => x.DatabaseId == member.DivisionId);

            rank = div.Ranks.Find(x => x.DatabaseId == member.RankId);
            return(rank != null);
        }
예제 #2
0
        internal void Remove(Division division)
        {
            WorkerSQL.DeleteByDivisiontId(division.Id);
            DivisionSQL.DeleteById(division.Id);
            Division deleteDivision = Divisions.Find(d => d.Id == division.Id);

            Divisions.Remove(division);
        }
예제 #3
0
파일: Group.cs 프로젝트: Yarpii/MTGRP
        public string GetDivisionName(Character member)
        {
            GroupDivision div = Divisions.Find(x => x.DatabaseId == member.DivisionId);

            if (div != null)
            {
                return(div.Name);
            }
            else
            {
                return("");
            }
        }
예제 #4
0
파일: Group.cs 프로젝트: Yarpii/MTGRP
        public string GetRankName(Character member)
        {
            GroupDivision div  = Divisions.Find(x => x.DatabaseId == member.DivisionId);
            GroupRank     rank = div.Ranks.Find(x => x.DatabaseId == member.RankId);

            if (rank != null)
            {
                return(rank.Name);
            }
            else
            {
                return("");
            }
        }
예제 #5
0
 public void ClearGuarding(CDivision division)
 {
     if (division.GuardPairing != Guid.Empty)
     {
         CDivision other = Divisions.Find(i => i.GuardPairing == division.ID);
         division.GuardPairing = Guid.Empty;
         if (other != null)
         {
             other.GuardPairing = Guid.Empty;
         }
         else
         {
             throw new Exception(MISSING_GUARD_PAIR_MESSAGE);
         }
     }
 }
예제 #6
0
        public int CheckDefensiveStrength(CDivision division)
        {
            int defense = 0;

            if (division.GuardPairing == Guid.Empty)
            {
                defense = (int)(division.UnitType.Stats[CUnit.STAT_DEFENSE]);
            }
            else
            {
                CDivision other = Divisions.Find(i => i.GuardPairing == division.ID);
                if (other != null)
                {
                    defense = (int)(other.UnitType.Stats[CUnit.STAT_DEFENSE]);
                }
                else
                {
                    throw new Exception(MISSING_GUARD_PAIR_MESSAGE);
                }
            }
            return(defense);
        }
예제 #7
0
파일: Group.cs 프로젝트: Yarpii/MTGRP
 public bool TryGetDivision(Character member, out GroupDivision div)
 {
     div = Divisions.Find(x => x.DatabaseId == member.DivisionId);
     return(div != null);
 }