public sealed class UtilitySetModelA utility set, and every gesture an editor makes to one.
Remarks
The counterpart to BehaviorTreeModel, and it is much smaller for the reason doc 37 § P5 gives: a utility set has no edges. There is no reparent, no reorder that changes meaning and no topology to keep valid — a set is a list of actions, each with a list of considerations, and every operation here is on one of those two lists.
⚠ Order does not matter, and that is worth stating because it is the opposite of a tree. A composite's child order is its priority; a set's action order is a display convenience and a tie-break, and nothing else. Moving a row up cannot change what an agent does unless two actions score exactly the same, which is why this model has a Move and no equivalent of the tree's careful reparent arithmetic.
Fields and properties (2)
public UtilitySetContent ContentThe set.
public int CountHow many actions it holds.
Events (1)
public Action<UtilitySetModel>? ChangedRaised after anything changes.
Methods (17)
public UtilitySetModel(UtilitySetContent content)Creates a model over a set.
public UtilityActionContent AddAction(string name, string task = "Wait")Adds an action.
public bool RemoveAction(UtilityActionContent action)Removes an action.
public bool Move(UtilityActionContent action, int offset)Moves an action up or down the list.
public UtilityConsiderationContent? AddConsideration(UtilityActionContent action, string name = "axis")Adds a consideration to an action.
public bool RemoveConsideration(UtilityActionContent action, UtilityConsiderationContent consideration)Removes a consideration.
public void SetCurve(UtilityConsiderationContent consideration, ResponseCurveKind kind)Changes the curve on a consideration.
public void SetShape(UtilityConsiderationContent consideration, float? slope = null, float? exponent = null, float? shift = null, float? centre = null)Changes a curve's four parameters.
public void SetInput(UtilityConsiderationContent consideration, UtilityInputKind kind, string? key = null, string? source = null)Points a consideration at a key.
public BehaviorKeyContent? AddKey(string name, BlackboardValueType type)Adds a blackboard key to the set's own list.
public int RenameKey(BehaviorKeyContent key, string name)Renames a key, and every consideration that reads it.
public int RemoveKey(BehaviorKeyContent key)Removes a key, leaving what read it dangling.
public static (float Score, float[] Detail) Preview(UtilityActionContent action, IReadOnlyDictionary<string, float> reading)What one action would score, and what each of its considerations contributed.
public static string Reads(UtilityConsiderationContent consideration)What a consideration reads, as a name a preview table can be keyed on.
public UtilitySetContent Snapshot()A deep copy, for an undo entry.
public void Replace(UtilitySetContent content)Puts a whole set back, which is what an undo does.
public static UtilitySetContent Copy(UtilitySetContent content)A deep copy of a set.
Used by (5)
- SnapshotCommandVixen.Editor.AssetEditors
- UtilitySetDocumentVixen.Editor.AssetEditors
- UtilitySetDocumentTestsVixen.Editor.AssetEditors.Tests
- UtilitySetViewVixen.Editor.AssetEditors
- UtilitySetViewTestsVixen.Editor.AssetEditors.Tests