コード例 #1
0
        private void GetValidTargets(IEnumerable <Pawn> targets)
        {
            targetList.Clear();
            foreach (var target in targets)
            {
                if (!TargetRange.Contains(target.Position.DistanceTo(User.Position)) ||
                    Ability.SuccessChanceOnTarget(target) < MinSuccessChance ||
                    !TargetMatchesTargetType(target) ||
                    AdditionalFilters.Any(filter => !filter.TargetMeetsFilter(target)))
                {
                    continue;
                }

                targetList.Add(target);
            }
        }
コード例 #2
0
 private int GetValidTargetsCount(IEnumerable <Pawn> targets)
 {
     return(targets.Count(target =>
                          TargetRange.Contains(target.Position.DistanceTo(User.Position)) && TargetMatchesTargetType(target) &&
                          AdditionalFilters.All(filter => filter.TargetMeetsFilter(target))));
 }