Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
EquippableItem Class Reference

Represents an item that can be equipped. More...

#include <EquippableItem.hpp>

Inheritance diagram for EquippableItem:
Inheritance graph
Collaboration diagram for EquippableItem:
Collaboration graph

Public Member Functions

 EquippableItem (int id, std::string name, Slot equippableToSlot, ItemStats stats=ItemStats(), bool isStackable=false)
 
 EquippableItem (const EquippableItemStruct &equippableItem)
 
Slot getEquippableSlot ()
 Returns the slot that the item can be equipped to. More...
 
ItemStatsgetStats ()
 Returns the stats of the item. More...
 
bool use (Entity *user) override
 Equips the item. More...
 
- Public Member Functions inherited from Item
 Item (int id, std::string name, bool isStackable=false)
 
 Item (const GeneralItemStruct &generalItem)
 
const int & getId ()
 Get the type id of the item. More...
 
const int & getInstanceId ()
 Get the instance id of the item. More...
 
const unsigned int & getStackSize ()
 Get the stack size of the item. More...
 
const std::string & getName ()
 Get the name of the item. More...
 
const bool & IsStackable ()
 Get whether the item is stackable or not. More...
 

Protected Attributes

Slot equippableToSlotM
 
ItemStats statsM
 
- Protected Attributes inherited from Item
int idM
 
int instanceIdM
 
const unsigned int stackSizeM = 1
 TODO: Implement amount functionality for stackable items. More...
 
std::string nameM
 
bool isStackableM
 

Additional Inherited Members

- Static Protected Attributes inherited from Item
static int nextInstanceIdM = 0
 

Detailed Description

Represents an item that can be equipped.

Constructor & Destructor Documentation

◆ EquippableItem() [1/2]

EquippableItem::EquippableItem ( int  id,
std::string  name,
Slot  equippableToSlot,
ItemStats  stats = ItemStats(),
bool  isStackable = false 
)

◆ EquippableItem() [2/2]

EquippableItem::EquippableItem ( const EquippableItemStruct equippableItem)

Member Function Documentation

◆ getEquippableSlot()

Slot EquippableItem::getEquippableSlot ( )

Returns the slot that the item can be equipped to.

Returns
Slot

◆ getStats()

ItemStats & EquippableItem::getStats ( )

Returns the stats of the item.

Returns
ItemStats&

◆ use()

bool EquippableItem::use ( Entity user)
overridevirtual

Equips the item.

Parameters
user
Returns
bool

Reimplemented from Item.

Here is the call graph for this function:

Member Data Documentation

◆ equippableToSlotM

Slot EquippableItem::equippableToSlotM
protected

◆ statsM

ItemStats EquippableItem::statsM
protected

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