示例#1
0
        private TargetValidator CreateValidator(Action <TargetValidatorParameters> set)
        {
            var p = new TargetValidatorParameters();

            set(p);
            return(new TargetValidator(p));
        }
示例#2
0
        public TargetValidator(TargetValidatorParameters p)
        {
            _isValidTarget    = p.IsValidTarget;
            _isValidZone      = p.IsValidZone;
            _mustBeTargetable = p.MustBeTargetable;

            _getMinCount = p.GetMinCount;
            _getMaxCount = p.GetMaxCount;

            Message = p.Message;
        }
示例#3
0
        public TargetValidator(TargetValidatorParameters p)
        {
            _isValidTarget = p.IsValidTarget;
              _isValidZone = p.IsValidZone;
              _mustBeTargetable = p.MustBeTargetable;

              _getMinCount = p.GetMinCount;
              _getMaxCount = p.GetMaxCount;

              Message = p.Message;
        }
示例#4
0
        public TargetSelector AddCost(Func <IsValidTargetBuilder, IsValidTargetBuilder> isValid,
                                      Action <TargetValidatorParameters> configure = null)
        {
            var validatorBuilder = isValid(new IsValidTargetBuilder());

            var validatorParameters = new TargetValidatorParameters(
                validatorBuilder.IsValidTarget,
                validatorBuilder.IsValidZone,
                false);

            if (configure != null)
            {
                configure(validatorParameters);
            }

            _costValidators.Add(new TargetValidator(validatorParameters));
            return(this);
        }
示例#5
0
 public TargetSpecs(TargetValidatorParameters parameters)
 {
     _p = parameters;
 }
示例#6
0
 public TargetSpecs(TargetValidatorParameters parameters)
 {
     _p = parameters;
 }