IHoldsItems
namespace Griff.Scenes;
public interface IHoldsItemsA component that holds items and resources: an Inventory, a strategy faction’s resources, a card hand’s mana. Every genre’s items are the one idea (see Items), so what a pickup gives, a recipe takes, a unit costs or a card costs is paid from whichever holds it. A script component can implement it too.
Properties
Section titled “Properties”ForTeam
Section titled “ForTeam”public abstract string? ForTeam { get; }The team these are the items of (see Teams), so anything on that team without items of its own collects and pays with them, e.g. a faction’s gold; empty when they’re only its entity’s own.
Methods
Section titled “Methods”public abstract void Add(string item, int count = 1)Puts count of item in.
public abstract int Count(string item)How many of item it holds (names ignore case).
public abstract bool Keeps(string item)True if it holds this kind of item at all: an inventory holds anything, a card hand only its mana.
public abstract bool Take(string item, int count = 1)Takes count of item out, if it has that many; returns whether it did.