Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.ItemInstanceData Class Reference
Inheritance diagram for PlatformerPro.ItemInstanceData:
PlatformerPro.EquipmentData PlatformerPro.ShopItemData

Public Member Functions

 ItemInstanceData ()
 Initializes a new instance of the PlatformerPro.ItemInstanceData class. More...
 
 ItemInstanceData (ItemInstanceData source)
 Initializes a new instance of the PlatformerPro.ItemInstanceData class by cloning another one then updating the amount. More...
 
 ItemInstanceData (string itemId, int amount)
 Initializes a new instance of the PlatformerPro.ItemInstanceData class. More...
 
virtual int Damage (int amount)
 Damage the item by the specified amount and return amount of damage done, or -1 if item destroyed. More...
 
virtual void RepairToMax ()
 Repairs an item so its durability goes back to max. More...
 
virtual void Repair (int amount)
 Repairs an item so its durability goes back to max. More...
 

Public Attributes

int amount
 Amount stored in the inventory. More...
 
int durability
 Amount of durability (health) remaining. Durability starts at max durability and is reduced as an item is Damaged. More...
 
int xp
 Store experience against this object. Can be used to allow items to level up. More...
 

Protected Attributes

string itemId
 Id of the item. More...
 
ItemTypeData data
 Cache item data, we need this a lot. More...
 

Properties

string ItemId [get, set]
 
ItemTypeData Data [get]
 Gets the ItemTypeData backing this item. More...
 

Constructor & Destructor Documentation

◆ ItemInstanceData() [1/3]

PlatformerPro.ItemInstanceData.ItemInstanceData ( )

Initializes a new instance of the PlatformerPro.ItemInstanceData class.

◆ ItemInstanceData() [2/3]

PlatformerPro.ItemInstanceData.ItemInstanceData ( ItemInstanceData  source)

Initializes a new instance of the PlatformerPro.ItemInstanceData class by cloning another one then updating the amount.

◆ ItemInstanceData() [3/3]

PlatformerPro.ItemInstanceData.ItemInstanceData ( string  itemId,
int  amount 
)

Initializes a new instance of the PlatformerPro.ItemInstanceData class.

Parameters
itemIdItem identifier.
amountAmount.

Member Function Documentation

◆ Damage()

virtual int PlatformerPro.ItemInstanceData.Damage ( int  amount)
virtual

Damage the item by the specified amount and return amount of damage done, or -1 if item destroyed.

Parameters
amountAmount of damage.

◆ Repair()

virtual void PlatformerPro.ItemInstanceData.Repair ( int  amount)
virtual

Repairs an item so its durability goes back to max.

Parameters
amountAmount ro repair.

◆ RepairToMax()

virtual void PlatformerPro.ItemInstanceData.RepairToMax ( )
virtual

Repairs an item so its durability goes back to max.

Member Data Documentation

◆ amount

int PlatformerPro.ItemInstanceData.amount

Amount stored in the inventory.

◆ data

ItemTypeData PlatformerPro.ItemInstanceData.data
protected

Cache item data, we need this a lot.

◆ durability

int PlatformerPro.ItemInstanceData.durability

Amount of durability (health) remaining. Durability starts at max durability and is reduced as an item is Damaged.

◆ itemId

string PlatformerPro.ItemInstanceData.itemId
protected

Id of the item.

◆ xp

int PlatformerPro.ItemInstanceData.xp

Store experience against this object. Can be used to allow items to level up.

Property Documentation

◆ Data

ItemTypeData PlatformerPro.ItemInstanceData.Data
get

Gets the ItemTypeData backing this item.

The data.

◆ ItemId

string PlatformerPro.ItemInstanceData.ItemId
getset

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