Class UZagalaSpecExamplesInventory#

Inheritance Relationships#

Base Type#

  • public UObject

Class Documentation#

class UZagalaSpecExamplesInventory : public UObject#

Inventory System Under Test (SUT).

An in-memory map from item name to quantity. No dependency on ZagalaSpec headers.

Used by the Inventory example feature to demonstrate ZagalaSpec patterns without requiring a PIE session or a game world.

Public Functions

UZagalaSpecExamplesInventory(const FObjectInitializer &ObjectInitializer = FObjectInitializer::Get())#
bool AddItem(const FString &ItemName, int32 Quantity)#

Adds Quantity of ItemName to stock.

Quantity must be > 0; otherwise logs a warning and returns false.

Parameters:
  • ItemName – The item to add stock for.

  • Quantity – The positive amount to add.

Returns:

True if the stock was updated; false if Quantity is not positive.

int32 GetCount(const FString &ItemName) const#

Returns the current stock count for ItemName, or 0 if not present.

Parameters:

ItemName – The item to look up.

Returns:

The stock count for ItemName, or 0 if not present.

void Reset()#

Clears all stock.