Vixen
02b45cc4
csharp
public static class ConstraintFieldAccess

The bridge between GoalKindSchema and the record it describes.

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

Remarks

⚠ An explicit table rather than reflection, and a test asserts it covers the schema. Reflection would be shorter and would be metadata a trimmed publish has already deleted — the same argument BuiltInImporters makes about discovering importers by scanning. The cost is that a field added to the schema and forgotten here is a field the panel cannot write, so the test that walks the schema and demands an accessor is not optional.

Text in and text out, because the panel is generated: a field's control is chosen from GoalFieldKind, and every control this editor has reads and writes a string. Parsing per kind here keeps the format of a vector in one place rather than in each of the four panels that show one.

Fields and properties (1)

  • public static IReadOnlyCollection<string> Properties

    Every property this table can drive.

Methods (3)

  • public static bool TryGet(string property, out ConstraintFieldAccessor accessor)

    How to read and write a field, if the panel knows how.

  • public static string Describe(ConstraintFrameRecord frame)

    A frame as one line: Surface belly 0.25 0.6, Socket held-item grip.

  • public static ConstraintFrameRecord? Parse(string? text)

    Reads a frame back from that line.

Used by (2)

  • AnimationClipViewVixen.Editor.AssetEditors
  • AuthoringTestsVixen.Editor.AssetEditors.Tests