public NotWearingStatAdd(RuleElement element, WearingExpression predicate, StatAddRule rule) : base(element, predicate, rule) { }
public WearingStatAdd(RuleElement element, WearingExpression predicate, StatAddRule rule) : base(element, rule) { this.predicate = predicate; this.predicate.PropertyChanged += PredicateValueChanged; }
public WearingStatAdd(RuleElement element, WearingExpression predicate, StatAddRule rule) : base(element, rule) { this.predicate = predicate; }
public static StatAddRule New(RuleElement ruleElement, XElement element) { // TODO: HANDLE: // requires, e.g.: requires="Epic Tier" (this is rather complex) // non-zero // zero // statmin, e.g.: statmin="Dexterity 13" // string name = element.Attribute(XNames.Name).Value; string value = element.Attribute(XNames.Value).Value; Identifier type = null; XAttribute attribute = element.Attribute(XNames.Type); if (attribute != null) { type = Identifier.Get(attribute.Value); } StatAddRule rule; int constantValue; if (Int32.TryParse(value, out constantValue)) { constantValue *= 2; if (element.Attribute(XNames.HalfPoint) != null) { constantValue += 1; } rule = new ConstantStatAdd(ruleElement, name, type, constantValue); } else { bool negative = false; if (value[0] == '+') { value = value.Substring(1); } else if (value[0] == '-') { negative = true; value = value.Substring(1); } if (value.StartsWith("ABILITYMOD")) { value = value.Substring(11, value.Length - 12); rule = new AbilityModStatAdd(ruleElement, name, type, value, negative); } else { // NOTE: The values that contain ':' are bugged; they don't actually work in cb either. rule = new StatStatAdd(ruleElement, name, type, value, negative); } } attribute = element.Attribute(XNames.Condition); if (attribute != null) { rule = new ConditionalStatAdd(ruleElement, attribute.Value, rule); } attribute = element.Attribute(XNames.Wearing); if (attribute != null) { rule = new WearingStatAdd(ruleElement, WearingExpression.New(attribute.Value), rule); } attribute = element.Attribute(XNames.NotWearing); if (attribute != null) { rule = new NotWearingStatAdd(ruleElement, WearingExpression.New(attribute.Value), rule); } return(rule); }