csharp
public sealed class ContainerA fixed number of slots, a policy, and — for an equipment set — a tag per slot.
Remarks
⚠ The slots array is not exposed for writing, and that is the point of the type. Everything that changes a container goes through Apply, because a mutation that is not part of a transaction is a mutation that cannot be rolled back — and a half-applied move is exactly how an item ends up in two places or in none.
Fields and properties (8)
public ContainerId IdWhat it is called.
public int CapacityHow many slots it has.
public ContainerPolicy PolicyWhat it takes.
public bool IsSlottedWhether it is an equipment set — one tag per slot.
public ReadOnlySpan<ItemInstance> SlotsWhat is in it.
public ItemInstance this[int slot]What is in one slot.
public int FreeSlotsHow many slots hold nothing.
public int TotalItemsHow many items it holds in total, stacks summed.
Methods (3)
public Container(ContainerId id, int capacity, ContainerPolicy? policy = null, GameplayTag[]? slotTags = null)Makes a container.
public GameplayTag SlotTag(int slot)Which slot tag a slot demands.
public int CountOf(DefId definition)How many of an item it holds, summed over every slot.
Used by (6)
- AtomicityTestsVixen.Gameplay.Inventory.Tests
- BindingTestsVixen.Gameplay.Inventory.Tests
- ConservationOracleTestsVixen.Gameplay.Inventory.Tests
- ContainerBasicsTestsVixen.Gameplay.Inventory.Tests
- ContainerSetVixen.Gameplay.Inventory
- ContainerTransactionTestsVixen.Gameplay.Inventory.Tests