public NodeValue?Calculate(IValueCalculationContext valueCalculationContext) { var paths = from source in _path.ModifierSource.InfluencingSources let path = new PathDefinition(source) from stat in _stat.Concat(_path.ConversionStats) select(stat, path); return(_aggregator(valueCalculationContext.GetValues(_form, paths))); }
private static NodeValue?CalculateActiveCurseIndex(IValueCalculationContext context, IStat activeCurses, int numericSkillId) { var i = 0; foreach (var activeCurseId in context.GetValues(Form.BaseAdd, activeCurses).WhereNotNull()) { if (activeCurseId == (NodeValue?)numericSkillId) { return((NodeValue?)i); } i++; } return(null); }
public static List <NodeValue?> GetValues( this IValueCalculationContext context, Form form, IStat stat) => context.GetValues(form, stat, PathDefinition.MainPath);
public static List <NodeValue?> GetValues( this IValueCalculationContext context, Form form, IStat stat, PathDefinition path) => context.GetValues(form, new[] { (stat, path) });
public NodeValue?Calculate(IValueCalculationContext valueCalculationContext) => _aggregator(valueCalculationContext.GetValues(_form, _stat, _path));