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); }
public bool IsNeutral(CreditLevelId nLevelId) { return(nLevelId == CreditLevelId.Credit_Neutrality); }
public bool IsFriend(CreditLevelId nLevelId) { return(nLevelId >= CreditLevelId.Credit_Friendly); }
public bool IsEnemy(CreditLevelId nLevelId) { return(nLevelId == CreditLevelId.Credit_Hostile); }
public void Add(int campType, CreditLevelId lvID) { CreditRelationMap.Add(campType, lvID); }