Пример #1
0
        public bool CheckRelation(ActorObj objA, ActorObj objB, TargetType type)
        {
            if (objA == null || objB == null)
            {
                return(false);
            }
            int           cmpA = objA.GetCamp();
            int           cmpB = objB.GetCamp();
            CreditLevelId cl   = CreditLevelId.Credit_Friendly;

            if (cmpB <= 0)
            {
                cl = CreditLevelId.Credit_Friendly;
            }
            else
            {
                CreditType creditA = GetCreditType(cmpA);
                if (creditA != null)
                {
                    cl = creditA.GetCredit(cmpB);
                }
            }
            if ((type & TargetType.ToEnemy) != 0 && IsEnemy(cl))
            {
                return(true);
            }

            if ((type & TargetType.ToFriend) != 0 && IsFriend(cl))
            {
                return(true);
            }

            if ((type & TargetType.ToNeutral) != 0 && IsNeutral(cl))
            {
                return(true);
            }
            return(false);
        }
Пример #2
0
 public bool IsNeutral(CreditLevelId nLevelId)
 {
     return(nLevelId == CreditLevelId.Credit_Neutrality);
 }
Пример #3
0
 public bool IsFriend(CreditLevelId nLevelId)
 {
     return(nLevelId >= CreditLevelId.Credit_Friendly);
 }
Пример #4
0
 public bool IsEnemy(CreditLevelId nLevelId)
 {
     return(nLevelId == CreditLevelId.Credit_Hostile);
 }
Пример #5
0
 public void Add(int campType, CreditLevelId lvID)
 {
     CreditRelationMap.Add(campType, lvID);
 }