Midnight Blue Game and Engine
Public Member Functions | Properties | List of all members
MB2D.Collectable Class Referenceabstract

Defines an object that can be contained within components and systems that operate on collectible items, such as Inventory. More...

Inheritance diagram for MB2D.Collectable:
Inheritance graph
Collaboration diagram for MB2D.Collectable:
Collaboration graph

Public Member Functions

 Collectable (string name, string tag, int initialCount)
 Initializes a new instance of the T:MB2D.Collectable class. More...
 
void Consume (int amount=1)
 Consumes a number of instances of the item More...
 
void Add (int amount=1)
 Adds a number of instances of this item to the container More...
 
abstract void Effect (Entity entity)
 The action to enact when the item is consumed or used More...
 

Properties

string Name [get]
 Gets the name of the item. More...
 
string Tag [get]
 Gets the items tag. More...
 
int Count [get]
 Gets the count of available instances of the item. More...
 

Detailed Description

Defines an object that can be contained within components and systems that operate on collectible items, such as Inventory.

Constructor & Destructor Documentation

§ Collectable()

MB2D.Collectable.Collectable ( string  name,
string  tag,
int  initialCount 
)
inline

Initializes a new instance of the T:MB2D.Collectable class.

Parameters
nameName to give to the item.
tagShort tag to give to the item.
initialCountInitial count to add to the container.

Member Function Documentation

§ Add()

void MB2D.Collectable.Add ( int  amount = 1)
inline

Adds a number of instances of this item to the container

Parameters
amountAmount to add.
Here is the call graph for this function:

§ Consume()

void MB2D.Collectable.Consume ( int  amount = 1)
inline

Consumes a number of instances of the item

Parameters
amountAmount to consume.

§ Effect()

abstract void MB2D.Collectable.Effect ( Entity  entity)
pure virtual

The action to enact when the item is consumed or used

Parameters
entityEntity to operate on.

Implemented in MidnightBlue.Fuel.

Here is the caller graph for this function:

Property Documentation

§ Count

int MB2D.Collectable.Count
get

Gets the count of available instances of the item.

The count.

§ Name

string MB2D.Collectable.Name
get

Gets the name of the item.

The name.

§ Tag

string MB2D.Collectable.Tag
get

Gets the items tag.

The tag.


The documentation for this class was generated from the following file: