Skip to main content

IInventoryStore<T>

An interface in Root.Township, Alta.Character.

A stack-like store of pickups in the player's inventory.

Properties​

MemberWhat it is
int Count { get; }Number of pickups stored.
T Source { get; }The object holding the store.

Methods​

MemberWhat it is
bool CanAdd(Pickup pickup)Whether a pickup can be added.
Pickup Peek()The top pickup without taking it.
bool Search(Func<Pickup, bool> predicate)True if any stored pickup matches a test.
bool TryPeek(out Pickup pickup)Gets the top pickup without taking it. False if empty.
bool TryPop(out Pickup pickup)Takes the top pickup, or the first one matching a test. False if none.
bool TryPop(out Pickup pickup, Func<Pickup, bool> predicate)Takes the top pickup, or the first one matching a test. False if none.
bool TryPush(Pickup pickup)Adds a pickup. False if it can't.

Used in​

Members of other types that take, return or hold a IInventoryStore&lt;T>: