public static bool IsAvailableForTarget([NotNull] this ProjectField field, [CanBeNull] IClaimSource target)
 {
     if (field == null)
     {
         throw new ArgumentNullException(nameof(field));
     }
     return(field.IsActive &&
            (field.FieldBoundTo == FieldBoundTo.Claim || field.ValidForNpc || !target.IsNpc()) &&
            (!field.GroupsAvailableFor.Any() || target.IsPartOfAnyOfGroups(field.GroupsAvailableFor)));
 }
Exemple #2
0
 public static bool IsAvailableForTarget(this ProjectField field, IClaimSource target)
 {
     return(field.IsActive &&
            (field.FieldBoundTo == FieldBoundTo.Claim || field.ValidForNpc || !target.IsNpc()) &&
            (!field.GroupsAvailableFor.Any() || target.IsPartOfAnyOfGroups(field.GroupsAvailableFor)));
 }