Vixen
c7401864
csharp
public sealed class BehaviorNodeSchema

The node library, declared once: what the editor offers, what a file may name, and what each one takes.

Read the guide page for this →

Remarks

⚠ A table rather than reflection over the assembly. ADR-002 rules out discovering types at load, and a declared table is also what lets a node carry a category, a description and a per-field tooltip — none of which a constructor signature has.

⚠ It lives in Vixen.Ai and not in the editor. A game loading a .vxbt at run time needs the same table to turn a type name into a decorator, so putting it in the editor would mean two of them and a way for them to disagree about what Cooldown's field is called.

The tasks in this table are the ones Vixen.Ai ships. A project's own task is registered with Add and appears in the popup beside them, which is how the library grows without this file growing.

Fields and properties (2)

  • public static BehaviorNodeSchema Default

    The shared one, for a caller that has no reason to build its own.

  • public IReadOnlyList<BehaviorNodeType> Types

    Everything in it, in declaration order.

Methods (9)

  • public BehaviorNodeSchema()

    Creates a schema holding everything Vixen.Ai ships.

  • public BehaviorNodeSchema Add(BehaviorNodeType type)

    Adds a type.

  • public bool TryGet(string type, out BehaviorNodeType? found)

    Looks a type up.

  • public IEnumerable<BehaviorNodeType> For(BehaviorSlot slot)

    Everything that may go in one slot.

  • public static string Read(BehaviorNodeType type, IReadOnlyDictionary<string, string> fields, string name)

    Reads a field off a bag, falling back to the declared default.

  • public static float Number(BehaviorNodeType type, IReadOnlyDictionary<string, string> fields, string name)

    Reads a number.

  • public static int Integer(BehaviorNodeType type, IReadOnlyDictionary<string, string> fields, string name)

    Reads a whole number.

  • public static bool Toggle(BehaviorNodeType type, IReadOnlyDictionary<string, string> fields, string name)

    Reads a tick.

  • public static T Choice<T>(BehaviorNodeType type, IReadOnlyDictionary<string, string> fields, string name) where T : struct, Enum

    Reads a choice as an enum.

Used by (18)

  • AuthorableNodeTestsVixen.Ai.Tests
  • BehaviorBuildContextVixen.Ai
  • BehaviorTreeContentCompilerVixen.Ai
  • BehaviorTreeResolverVixen.Ai
  • BuildStateVixen.Ai
  • PatrolChaseGiveUpTestsVixen.Ai.Nodes.Tests
  • PerceptionNodeTestsVixen.Ai.Perception.Tests
  • PerceptionNodesVixen.Ai.Perception
  • QueryNodesVixen.Ai.Nodes
  • WorldNodeRegistrationTestsVixen.Ai.Nodes.Tests
  • WorldNodesVixen.Ai.Nodes
  • BehaviorSearchPopupVixen.Editor.AssetEditors
  • BehaviorTreeDocumentVixen.Editor.AssetEditors
  • BehaviorTreeDocumentTestsVixen.Editor.AssetEditors.Tests
  • BehaviorTreeModelVixen.Editor.Ai
  • BehaviorTreeModelTestsVixen.Editor.Ai.Tests
  • BehaviorTreeViewVixen.Editor.AssetEditors
  • LiveAgentVixen.Editor.AssetEditors.Tests