public NodeValue?Calculate(IValueCalculationContext context) { var @base = context.GetValue(_stat, NodeType.Base, _path); if (@base is null) { return(null); } var increase = context.GetValue(_stat, NodeType.Increase, _path) ?? new NodeValue(0); var more = context.GetValue(_stat, NodeType.More, _path) ?? new NodeValue(1); return(_stat.Round(_stat.Round(@base * more) * (1 + increase))); }
public NodeValue?Calculate(IValueCalculationContext context) { var baseSet = context.GetValue(_stat, NodeType.BaseSet, _path); var baseAdd = context.GetValue(_stat, NodeType.BaseAdd, _path); if (baseSet is null && baseAdd is null) { return(null); } return(_stat.Round((baseSet ?? new NodeValue(0)) + (baseAdd ?? new NodeValue(0)))); }
public NodeValue?Calculate(IValueCalculationContext context) => _stat.Round(context.GetValue(_stat, NodeType.TotalOverride) ?? context.GetValue(_stat, NodeType.Subtotal));