ItemClass Class Reference

Class for simple reference to item information. More...

#include <item.hpp>

List of all members.

Public Member Functions

 ItemClass (int id, ItemType type, Script *s=NULL)
bool use (Being *itemUser)
 Applies the modifiers of an item to a given user.
ItemType 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.
const ItemModifiersgetModifiers () const
 Gets item modifiers.
void setModifiers (const ItemModifiers &modifiers)
 Sets item modifiers.
int getDatabaseID ()
 Gets database ID.
void setSpriteID (int spriteID)
 Sets the sprite ID.
int getSpriteID ()
 Gets the sprite ID.
void setScript (Script *s)
 Sets the script that is to be used.
void setAttackZone (AttackZone *attackZone)
 Set attack zone (only needed when the item is a weapon).
const AttackZone * getAttackZone () const
 Gets attack zone of weapon (returns NULL for non-weapon items).


Detailed Description

Class for simple reference to item information.

Definition at line 174 of file item.hpp.


Member Function Documentation

bool ItemClass::use ( Being itemUser  ) 

Applies the modifiers of an item to a given user.

Returns:
true if the item was sucessfully used and should be removed.

Definition at line 145 of file item.cpp.

References ItemModifiers::applyAttributes(), Script::execute(), Script::prepare(), and Script::push().


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

Generated on Sun Apr 26 17:30:46 2009 for TMW Server Collection by  doxygen 1.5.5