Beispiel #1
0
        public TargetsCandidates GenerateCandidates(object triggerMessage = null, ITarget excluded = null)
        {
            var all = new TargetsCandidates();

            foreach (var selector in _costValidators)
            {
                var candidates = new TargetCandidates();

                foreach (var target in GenerateTargets(selector.IsZoneValid))
                {
                    if (target != excluded && selector.IsTargetValid(target, triggerMessage))
                    {
                        candidates.Add(target);
                    }
                }

                all.AddCostCandidates(candidates);
            }

            foreach (var selector in _effectValidators)
            {
                var candidates = new TargetCandidates();

                foreach (var target in GenerateTargets(selector.IsZoneValid))
                {
                    if (target != excluded && selector.IsTargetValid(target, triggerMessage))
                    {
                        candidates.Add(target);
                    }
                }

                all.AddEffectCandidates(candidates);
            }

            return(all);
        }
 public void AddEffectCandidates(TargetCandidates candidates)
 {
     _effectCandidates.Add(candidates);
 }
 public void AddCostCandidates(TargetCandidates candidates)
 {
     _costCandidates.Add(candidates);
 }