Vixen
02b45cc4
csharp
public sealed class MoveSetDocument

A movement vocabulary, open for editing: a table of moves and a list of rules.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A table, because a move set is a table. Everything a person does to one — adding a row, changing a facet, retiming an entry, reordering a rule — is one entry on the undo stack, the same shape AnimationClipDocument takes.

⚠ Facets are edited as text and parsed here, not as a pair of drop-downs. The vocabulary is a project's own and grows while somebody is working; a control that could only offer the values already in use would make adding the first style=limp impossible from inside the editor. The one key that is not a project's business — role — is checked at import, where the whole set can be seen at once.

Fields and properties (5)

  • public const string Extension

    What an authored move set is written as.

  • public string AssetPath

    Where the file is, absolute.

  • public MoveSetContent Set

    The set.

  • public string? LoadError

    Why the file would not read, or .

  • public Func<string, MoveSetContent?>? Resolve

    How a name in Bases is turned into a set.

Events (1)

  • public Action<MoveSetDocument>? Changed

    Raised after anything changes the set.

Methods (13)

  • public MoveSetDocument(EditorProject project, AssetId asset, string path)

    Opens a move set.

  • public MoveEntryRecord Add(MoveEntryRecord entry)

    Adds a row, undoably.

  • public bool Remove(MoveEntryRecord entry)

    Removes a row, undoably.

  • public void SetField<T>(MoveEntryRecord entry, string label, Func<MoveEntryRecord, T> read, Action<MoveEntryRecord, T> write, T value)

    Changes one of a row's numbers or its name, undoably.

  • public bool SetFacets(MoveEntryRecord entry, string text)

    Replaces a row's facets from a written list, undoably.

  • public static List<FacetRecord>? Parse(string? text)

    Reads a written facet list, or if any pair is malformed.

  • public static string Describe(MoveEntryRecord entry)

    A row's facets, written the way SetFacets reads them.

  • public TransitionRuleRecord AddRule(TransitionRuleRecord rule)

    Adds a transition rule at the end, undoably.

  • public bool RemoveRule(TransitionRuleRecord rule)

    Removes a transition rule, undoably.

  • public bool MoveRule(TransitionRuleRecord rule, int by)

    Moves a rule up or down the list, undoably.

  • public IReadOnlyList<(string Address, MoveSetContent Content)> Underlay()

    The base sets this one overlays, in order, as far as they could be resolved.

  • public MoveSet Preview()

    The set as the selector sees it, with nothing loaded.

  • protected override void SaveCore()

    Writes the document back to wherever it came from.

Used by (5)

  • AnimationBinderVixen.Editor.AssetEditors
  • AnimationWiringTestsVixen.Editor.App.Tests
  • MoveSetEditorFactoryVixen.Editor.AssetEditors
  • MoveSetTestsVixen.Editor.AssetEditors.Tests
  • MoveSetViewVixen.Editor.AssetEditors