Skip to main content

GDTKStatsManager.GetValue

Declaration#

public static Double GetValue(string formula, Dictionary<string, StatSource> sources)

Parameters#

NameDescription
formulaFormula to parse
sourcesDictionary of all Stat Sources available

Description#

Get the parsed value of a formula

Usage#

Example
using NullSave.GDTK;using NullSave.GDTK.Stats;using System.Collections.Generic;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(StatSource requester, StatSource other)    {        Dictionary<string, StatSource> source = new Dictionary<string, StatSource>        {            { "", requester },            { "other", other },            { "global", ToolRegistry.GetComponent<GlobalStats>().source }        };
        double result = GDTKStatsManager.GetValue("health + 0.5", source);    }
}