A class in Root.Township, Alta.Intelligence.
Scoring rule that runs a function you supply on the agent (cast to T) and the target. Made by CreateTargetOperation.Formula; built-in creature actions use it for custom checks.
Constructors
| Member | What it is |
|---|
Formula(string name, Func<T, ITarget, float> evaluate) | Creates a Formula from name and evaluate. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private Func<T, ITarget, float> evaluate | The function that does the scoring. |
private string name | Name shown by ToString, for debugging. |
Methods
| Member | What it is |
|---|
override float Evaluate(Agent agent, ITarget target) | Casts the agent to T and returns the function's result. Throws if the agent isn't a T. |
override string ToString() | Returns "Formula (name)". |