Skip to main content

DockStore

A class in Root.Township, Alta.Character.

Inventory store wrapping one PickupDock (back, hip or belt slot) so Inventory can push, pop and search it like the hands.

Constructors​

MemberWhat it is
DockStore(PickupDock dock)Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Properties​

MemberWhat it is
int Count { get; }How many items the dock holds (QuantityStored).
PickupDock Source { get; }The wrapped dock.

Methods​

MemberWhat it is
bool CanAdd(Pickup pickup)True if the dock would accept the pickup.
Pickup Peek()The docked pickup, or null.
bool Search(Func<Pickup, bool> predicate)Tests the docked pickup with the predicate. For a pouch, tests the items in its sub-docks instead.
bool TryPeek(out Pickup pickup)Gets the docked pickup and returns whether there is one.
bool TryPop(out Pickup pickup)Undocks one of the docked item, optionally only if it matches the predicate.
bool TryPop(out Pickup pickup, Func<Pickup, bool> predicate)Undocks one of the docked item, optionally only if it matches the predicate.
bool TryPush(Pickup pickup)Docks one of the pickup into this dock. True if the dock returned Ok.