private TargetValidator CreateValidator(Action <TargetValidatorParameters> set) { var p = new TargetValidatorParameters(); set(p); return(new TargetValidator(p)); }
public TargetValidator(TargetValidatorParameters p) { _isValidTarget = p.IsValidTarget; _isValidZone = p.IsValidZone; _mustBeTargetable = p.MustBeTargetable; _getMinCount = p.GetMinCount; _getMaxCount = p.GetMaxCount; Message = p.Message; }
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); }
public TargetSpecs(TargetValidatorParameters parameters) { _p = parameters; }