Vixen
02b45cc4
csharp
public readonly record struct AssetId

What moved. An address, because in this engine there is no other kind of name.

Read the guide page for this →

Remarks

ADR-013: an asset is named by its addressable address — items/greatsword, currency/gold. That is deliberate rather than convenient. The support tool's question is "what happened to my sword", and answering it means joining the ledger to the thing the player is looking at in their bag; a numeric id minted by the database would need a second registry mapping it back to content, which is the registry NetworkSceneId and the prefab id already refuse to have.

⚠ An asset is a kind, not an instance. A ledger row says "three of items/potion", not "this potion". Doc 28 owns instances — a sword with rolled stats is an entity with a durable id — and the ledger's job is the quantity that moved, because that is the quantity conservation is a statement about.

Fields and properties (3)

  • public static AssetId None

    Nothing.

  • public string Address

    The address. Null only on default.

  • public bool IsValid

    Whether this names an asset at all.

Methods (4)

  • public AssetId(string Address)

    What moved. An address, because in this engine there is no other kind of name.

  • public bool Equals(AssetId other)

    Whether two ids name the same asset.

  • public override int GetHashCode()

    Returns the hash code for this instance.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

Used by (12)

  • AssetMovementVixen.Live.Persistence
  • ConservationTestsVixen.Live.Persistence.Tests
  • ILedgerVixen.Live.Persistence
  • LedgerAccountTestsVixen.Live.Persistence.Tests
  • LedgerDiscrepancyVixen.Live.Persistence
  • LedgerEntryVixen.Live.Persistence
  • LedgerIntentVixen.Live.Persistence
  • LedgerQueryVixen.Live.Persistence
  • LedgerTestsVixen.Live.Persistence.Tests
  • MemoryPersistenceVixen.Live.Persistence
  • SqlPersistenceVixen.Live.Persistence
  • TransferFleetVixen.Live.Realm.Tests