Vixen
caa30e12
csharp
public readonly record struct BehaviorBuildContext

Everything a node factory needs to turn one row of a file into an object.

Read the guide page for this →

Remarks

⚠ A factory reads its fields through here rather than off the dictionary. The dictionary holds what a file happened to say; this applies the declared default when it said nothing, resolves a key name to the index the runtime uses, and reports a name that is not on the blackboard instead of quietly binding key zero.

Fields and properties (4)

  • public BehaviorNodeType Type

    Its declaration in the schema, which is where the defaults and the field list live.

  • public BlackboardLayout Layout

    The blackboard the tree's keys were compiled into.

  • public IReadOnlyDictionary<string, string> Fields

    What the file said.

  • public ICollection<BehaviorTreeDiagnostic> Diagnostics

    Where to say what could not be resolved.

Methods (9)

  • public BehaviorBuildContext(BehaviorNodeType Type, BlackboardLayout Layout, IReadOnlyDictionary<string, string> Fields, ICollection<BehaviorTreeDiagnostic> Diagnostics)

    Everything a node factory needs to turn one row of a file into an object.

  • public string Text(string field)

    A field's text.

  • public float Number(string field)

    A field as a number.

  • public int Integer(string field)

    A field as a whole number.

  • public bool Toggle(string field)

    A field as a switch.

  • public T Choice<T>(string field) where T : struct, Enum

    A field as one of an enumeration's names.

  • public Symbol Word(string field)

    A field as an interned word.

  • public BlackboardKey Key(string field)

    A field naming a blackboard key, resolved to its index.

  • public void Report(string message)

    Records a problem with this row.

Used by (5)

  • BehaviorTreeResolverVixen.Ai
  • BuildStateVixen.Ai
  • PerceptionNodesVixen.Ai.Perception
  • QueryNodesVixen.Ai.Nodes
  • WorldNodesVixen.Ai.Nodes