ItemClass Class Reference

#include <item.hpp>

List of all members.


Detailed Description

Class for simple reference to item information.

Definition at line 128 of file item.hpp.

Public Member Functions

 ItemClass (int id, int type)
bool use (Being *itemUser)
 The function called to use an item applying only the modifiers (for simple items...).
int getType () const
 Gets item type.
int getWeight () const
 Gets item weight.
void setWeight (int weight)
 Sets item weight.
int getCost () const
 Gets unit cost of these items.
void setCost (int cost)
 Sets unit cost of these items.
int getMaxPerSlot () const
 Gets max item per slot.
void setMaxPerSlot (int perSlot)
 Sets max item per slot.
Modifiers const & getModifiers () const
 Gets item modifiers.
void setModifiers (Modifiers const &modifiers)
 Sets item modifiers.
void setScriptName (std::string const &name)
 Sets associated script name.
int getDatabaseID ()
 Gets database ID.
void setSpriteID (unsigned short spriteID)
 Sets the sprite ID.
unsigned short getSpriteID ()
 Gets the sprite ID.

Private Member Functions

bool runScript (Being *itemUser)
 Runs the associated script when using the item, if any.

Private Attributes

unsigned short mDatabaseID
unsigned short mSpriteID
 The sprite that should be shown to the character.
unsigned char mType
 Type: usable, equipment.
unsigned short mWeight
 Weight of the item.
unsigned short mCost
 Unit cost the item.
unsigned short mMaxPerSlot
 Max item amount per slot in inventory.
std::string mScriptName
 Item script.
Modifiers mModifiers
 Item modifiers.


Constructor & Destructor Documentation

ItemClass::ItemClass int  id,
int  type
[inline]
 

Definition at line 131 of file item.hpp.


Member Function Documentation

int ItemClass::getCost  )  const [inline]
 

Gets unit cost of these items.

Definition at line 162 of file item.hpp.

int ItemClass::getDatabaseID  )  [inline]
 

Gets database ID.

Definition at line 204 of file item.hpp.

int ItemClass::getMaxPerSlot  )  const [inline]
 

Gets max item per slot.

Definition at line 174 of file item.hpp.

Modifiers const& ItemClass::getModifiers  )  const [inline]
 

Gets item modifiers.

Definition at line 186 of file item.hpp.

unsigned short ItemClass::getSpriteID  )  [inline]
 

Gets the sprite ID.

Definition at line 216 of file item.hpp.

int ItemClass::getType  )  const [inline]
 

Gets item type.

Definition at line 144 of file item.hpp.

int ItemClass::getWeight  )  const [inline]
 

Gets item weight.

Definition at line 150 of file item.hpp.

bool ItemClass::runScript Being itemUser  )  [private]
 

Runs the associated script when using the item, if any.

Definition at line 39 of file item.cpp.

void ItemClass::setCost int  cost  )  [inline]
 

Sets unit cost of these items.

Definition at line 168 of file item.hpp.

void ItemClass::setMaxPerSlot int  perSlot  )  [inline]
 

Sets max item per slot.

Definition at line 180 of file item.hpp.

void ItemClass::setModifiers Modifiers const &  modifiers  )  [inline]
 

Sets item modifiers.

Definition at line 192 of file item.hpp.

void ItemClass::setScriptName std::string const &  name  )  [inline]
 

Sets associated script name.

Definition at line 198 of file item.hpp.

void ItemClass::setSpriteID unsigned short  spriteID  )  [inline]
 

Sets the sprite ID.

Definition at line 210 of file item.hpp.

void ItemClass::setWeight int  weight  )  [inline]
 

Sets item weight.

Definition at line 156 of file item.hpp.

bool ItemClass::use Being itemUser  ) 
 

The function called to use an item applying only the modifiers (for simple items...).

Definition at line 26 of file item.cpp.


Member Data Documentation

unsigned short ItemClass::mCost [private]
 

Unit cost the item.

Definition at line 232 of file item.hpp.

unsigned short ItemClass::mDatabaseID [private]
 

Definition at line 228 of file item.hpp.

unsigned short ItemClass::mMaxPerSlot [private]
 

Max item amount per slot in inventory.

Definition at line 233 of file item.hpp.

Modifiers ItemClass::mModifiers [private]
 

Item modifiers.

Definition at line 235 of file item.hpp.

std::string ItemClass::mScriptName [private]
 

Item script.

Definition at line 234 of file item.hpp.

unsigned short ItemClass::mSpriteID [private]
 

The sprite that should be shown to the character.

Definition at line 229 of file item.hpp.

unsigned char ItemClass::mType [private]
 

Type: usable, equipment.

Definition at line 230 of file item.hpp.

unsigned short ItemClass::mWeight [private]
 

Weight of the item.

Definition at line 231 of file item.hpp.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 15:39:18 2007 for TMW Server by  doxygen 1.3.9.1