Item Class Reference

#include <item.h>

Inheritance diagram for Item:

ShopItem

List of all members.


Detailed Description

Represents one or more instances of a certain item type.

Definition at line 32 of file item.h.


Public Member Functions

 Item (int id=-1, int quantity=0, bool equipment=false, bool equipped=false)
 Constructor.
 ~Item ()
 Destructor.
void setId (int id)
 Sets the item id, identifying the item type.
int getId () const
 Returns the item id.
ImagegetImage ()
 Returns the item image.
void setQuantity (int quantity)
 Sets the number of items.
void increaseQuantity (int amount)
 Increases the number of items by the given amount.
int getQuantity () const
 Returns the number of items.
void setEquipment (bool equipment)
 Sets whether this item is considered equipment.
bool isEquipment () const
 Returns whether this item is considered equipment.
void setEquipped (bool equipped)
 Sets whether this item is equipped.
bool isEquipped () const
 Returns whether this item is equipped.
void setInvIndex (int index)
 Sets the inventory index of this item.
int getInvIndex () const
 Returns the inventory index of this item.
const ItemInfogetInfo () const
 Returns information about this item type.

Protected Attributes

int mId
 Item type id.
ImagemImage
 Item image.
int mQuantity
 Number of items.
bool mEquipment
 Item is equipment.
bool mEquipped
 Item is equipped.
int mInvIndex
 Inventory index.

Constructor & Destructor Documentation

Item::Item ( int  id = -1,
int  quantity = 0,
bool  equipment = false,
bool  equipped = false 
)

Constructor.

Definition at line 28 of file item.cpp.

Item::~Item (  ) 

Destructor.

Definition at line 36 of file item.cpp.


Member Function Documentation

void Item::setId ( int  id  ) 

Sets the item id, identifying the item type.

Definition at line 42 of file item.cpp.

int Item::getId (  )  const [inline]

Returns the item id.

Definition at line 54 of file item.h.

Image* Item::getImage (  )  [inline]

Returns the item image.

Definition at line 59 of file item.h.

void Item::setQuantity ( int  quantity  )  [inline]

Sets the number of items.

Definition at line 64 of file item.h.

void Item::increaseQuantity ( int  amount  )  [inline]

Increases the number of items by the given amount.

Definition at line 69 of file item.h.

int Item::getQuantity (  )  const [inline]

Returns the number of items.

Definition at line 74 of file item.h.

void Item::setEquipment ( bool  equipment  )  [inline]

Sets whether this item is considered equipment.

Definition at line 79 of file item.h.

bool Item::isEquipment (  )  const [inline]

Returns whether this item is considered equipment.

Definition at line 84 of file item.h.

void Item::setEquipped ( bool  equipped  )  [inline]

Sets whether this item is equipped.

Definition at line 89 of file item.h.

bool Item::isEquipped (  )  const [inline]

Returns whether this item is equipped.

Definition at line 94 of file item.h.

void Item::setInvIndex ( int  index  )  [inline]

Sets the inventory index of this item.

Definition at line 99 of file item.h.

int Item::getInvIndex (  )  const [inline]

Returns the inventory index of this item.

Definition at line 104 of file item.h.

const ItemInfo& Item::getInfo (  )  const [inline]

Returns information about this item type.

Definition at line 109 of file item.h.


Member Data Documentation

int Item::mId [protected]

Item type id.

Definition at line 112 of file item.h.

Image* Item::mImage [protected]

Item image.

Definition at line 113 of file item.h.

int Item::mQuantity [protected]

Number of items.

Definition at line 114 of file item.h.

bool Item::mEquipment [protected]

Item is equipment.

Definition at line 115 of file item.h.

bool Item::mEquipped [protected]

Item is equipped.

Definition at line 116 of file item.h.

int Item::mInvIndex [protected]

Inventory index.

Definition at line 117 of file item.h.


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

Generated on Sun Apr 26 17:30:43 2009 for The Mana World by  doxygen 1.5.5