Vixen
c7401864
csharp
public sealed class LootTableModel

One loot table, open for editing.

Read the guide page for this →

Remarks

The document is a LootTableDefinition. There is no editor-side model of a table to keep in step with the runtime's — the same bargain Vixen.Editor.Ai makes, and for the same reason: a second representation is a second thing to migrate and a second place for the odds to differ.

Every gesture is one operation and one Changed, so an undo stack is snapshot-in, snapshot-out over Snapshot and Restore rather than a per-field diff.

Fields and properties (2)

Events (1)

  • public Action<LootTableModel>? Changed

    Raised after anything changes the table.

Methods (10)

  • public LootTableModel(LootTableDefinition table)

    Opens a table.

  • public int AddEntry(LootEntryDefinition? entry = null)

    Adds a row.

  • public bool RemoveEntry(int row)

    Removes a row.

  • public bool MoveEntry(int from, int to)

    Moves a row.

  • public bool Edit(int row, Action<LootEntryDefinition> edit)

    Changes a row, whatever the gesture touched.

  • public void SetRolls(int rolls)

    Sets how many times the weighted pick runs.

  • public void SetPity(PityPolicyDefinition? pity)

    Sets the pity policy, or clears it.

  • public LootTableDefinition Snapshot()

    A copy of the table, for an undo stack to hold.

  • public void Restore(LootTableDefinition snapshot)

    Puts a snapshot back.

  • public IReadOnlyList<LootProblem> Validate()

    What is wrong with the table, as rows an editor can highlight.

Used by (1)

  • LootTableModelTestsVixen.Editor.Gameplay.Loot.Tests