Ejemplo n.º 1
0
        public virtual void Receive(SelectionChanged message)
        {
            if (TargetValidator.MaxCount != null &&
                _selection.Count >= TargetValidator.MaxCount.GetValue(_x))
            {
                return;
            }

            if (_selection.Contains(message.Selection))
            {
                _targetUnselected(message.Selection);
                _selection.Remove(message.Selection);
                return;
            }

            if (TargetValidator.HasValidZone(message.Selection) == false)
            {
                return;
            }

            if (TargetValidator.IsTargetValid(message.Selection, _triggerMessage) == false)
            {
                return;
            }

            _targetSelected(message.Selection);
            _selection.Add(message.Selection);

            if (CanAutoComplete)
            {
                Done();
            }
        }
Ejemplo n.º 2
0
            private bool NoValidTargets(TargetValidator validator)
            {
                foreach (var target in GenerateTargets(validator.IsZoneValid))
                {
                    if (validator.IsTargetValid(target, D._p.Effect.TriggerMessage <object>()))
                    {
                        return(false);
                    }
                }

                return(true);
            }