Corgi Engine  v8.8
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< MMInventoryEvent >

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 More...
 
virtual void OnMMEvent (MMInventoryEvent inventoryEvent)
 Handles inventory events, updates the text if needed More...
 
virtual int ComputeQuantity ()
 Computes the quantity of the item in the target inventories More...
 
virtual bool ShouldUpdate (string inventoryName)
 Returns true if the inventory name passed in parameters is one of the target inventories, false otherwise More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< MMInventoryEvent >
void OnMMEvent (T eventType)
 

Public Attributes

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

Protected Member Functions

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

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: