Vixen
c7401864
csharp
public sealed class ContainerTransaction

A set of moves that happen entirely or not at all.

Read the guide page for this →

Remarks

Doc 28 § Inventory: "every mutation is a transaction over a set of containers". Move, split, merge, swap and equip are not five operations — they are Move with different counts and destinations, which is why there is one validator and one place a duplication bug could be.

⚠ Atomicity is the whole reason the type exists, and it is not an optimisation to skip it. A two-step move — take from the bank, put in the bag — that fails on the second step has destroyed an item; one that applies the second step first has duplicated it. The transaction snapshots every container it touches before the first step and restores them all if any step fails.

Fields and properties (1)

  • public int Count

    How many steps it has.

Methods (5)

Used by (5)

  • AtomicityTestsVixen.Gameplay.Inventory.Tests
  • BindingTestsVixen.Gameplay.Inventory.Tests
  • ConservationOracleTestsVixen.Gameplay.Inventory.Tests
  • ContainerSetVixen.Gameplay.Inventory
  • ContainerTransactionTestsVixen.Gameplay.Inventory.Tests