public readonly record struct LedgerAccountOne end of a movement of value: a character, or a part of the world.
Remarks
⚠ The world has accounts, and that is what makes conservation checkable. Doc 27 § Persistence says every movement of value is a ledger row; it does not say what a loot drop moves value from. If the answer is "nowhere", then every intent that creates an item and every intent that destroys one is an exception to the sum-to-zero rule, and a rule with exceptions cannot be a database constraint. So a drop is a transfer out of world/loot, a vendor sale is a transfer into world/vendor, and the invariant becomes total: every intent's deltas sum to zero, per asset, always.
The cost is a handful of named accounts whose balances go steadily negative, and that is not a defect — world/loot's balance is exactly how much of an asset has entered the economy, which is the number an economy dashboard is built to show and which no other schema gives you for free. Doc 28 § Economy is the consumer.
⚠ default is Nowhere and carries a null World. A struct's property initialisers do not run for default(T), the same wart RealmInstanceId documents, so every member here survives it.
Fields and properties (9)
public const string LootThe world account a drop comes out of.
public const string VendorThe world account a vendor sale goes into.
public const string SinkThe world account currency is destroyed into — repair costs, taxes, fees.
public const string EscrowThe world account mail and auction escrow is held in while in flight.
public PlayerKey PlayerWhose account, when it is a character's.
public string WorldWhich part of the world, when it is not. Empty for a character.
public static LedgerAccount NowhereNeither. The value a zeroed field holds, and never a valid end of a movement.
public bool IsValidWhether this names an account at all.
public bool IsPlayerWhether a character holds it.
Methods (6)
public static LedgerAccount Of(PlayerKey player)A character's account.
public static LedgerAccount Of(string name)A named part of the world.
public static bool TryParse(string? text, out LedgerAccount account)Reads one back.
public bool Equals(LedgerAccount other)Whether two accounts are the same one.
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