TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.InventoryEngine.InventoryCounterDisplay Class Reference

Use this class to display the total quantity of one or more given items in one or more given inventories. More...

Inheritance diagram for MoreMountains.InventoryEngine.InventoryCounterDisplay:
MoreMountains.Tools.MMEventListener< T > MoreMountains.Tools.MMEventListenerBase

Public Member Functions

void UpdateText ()
 A public method used to update the target text with the total quantity of the item(s) in the target inventories.
virtual void OnMMEvent (MMInventoryEvent inventoryEvent)
 Handles inventory events, updates the text if needed.
virtual int ComputeQuantity ()
 Computes the quantity of the item in the target inventories.
virtual bool ShouldUpdate (string inventoryName)
 Returns true if the inventory name passed in parameters is one of the target inventories, false otherwise.
Public Member Functions inherited from MoreMountains.Tools.MMEventListener< T >
void OnMMEvent (T eventType)

Public Attributes

List< InventoryItemItem
 a list of the items to count
List< InventoryTargetInventories
 the inventories in which to count the items
Text TargetText
 the text UI to update with the total quantity of the item(s) in the target inventories
string DisplayFormat = "0"
 the format to apply to the text

Protected Member Functions

virtual void OnEnable ()
 On Enable, we start listening for MMInventoryEvents.
virtual void OnDisable ()
 On Disable, we stop listening for MMInventoryEvents.

Detailed Description

Use this class to display the total quantity of one or more given items in one or more given inventories.

Member Function Documentation

◆ ComputeQuantity()

virtual int MoreMountains.InventoryEngine.InventoryCounterDisplay.ComputeQuantity ( )
virtual

Computes the quantity of the item in the target inventories.

Returns

◆ OnDisable()

virtual void MoreMountains.InventoryEngine.InventoryCounterDisplay.OnDisable ( )
protectedvirtual

On Disable, we stop listening for MMInventoryEvents.

◆ OnEnable()

virtual void MoreMountains.InventoryEngine.InventoryCounterDisplay.OnEnable ( )
protectedvirtual

On Enable, we start listening for MMInventoryEvents.

◆ OnMMEvent()

virtual void MoreMountains.InventoryEngine.InventoryCounterDisplay.OnMMEvent ( MMInventoryEvent inventoryEvent)
virtual

Handles inventory events, updates the text if needed.

Parameters
inventoryEvent

◆ ShouldUpdate()

virtual bool MoreMountains.InventoryEngine.InventoryCounterDisplay.ShouldUpdate ( string inventoryName)
virtual

Returns true if the inventory name passed in parameters is one of the target inventories, false otherwise.

Parameters
inventoryName
Returns

◆ UpdateText()

void MoreMountains.InventoryEngine.InventoryCounterDisplay.UpdateText ( )

A public method used to update the target text with the total quantity of the item(s) in the target inventories.

Member Data Documentation

◆ DisplayFormat

string MoreMountains.InventoryEngine.InventoryCounterDisplay.DisplayFormat = "0"

the format to apply to the text

◆ Item

List<InventoryItem> MoreMountains.InventoryEngine.InventoryCounterDisplay.Item

a list of the items to count

◆ TargetInventories

List<Inventory> MoreMountains.InventoryEngine.InventoryCounterDisplay.TargetInventories

the inventories in which to count the items

◆ TargetText

Text MoreMountains.InventoryEngine.InventoryCounterDisplay.TargetText

the text UI to update with the total quantity of the item(s) in the target inventories


The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/ThirdParty/MoreMountains/InventoryEngine/InventoryEngine/Scripts/GUI/InventoryCounterDisplay.cs