#include <Item.h>
Inheritance diagram for ogs::core::Item:
Public Types | |
typedef double | Worth |
Measures how much the item is worth. | |
typedef std::string | Material |
Material that this item is primarily made of. | |
typedef unsigned | Hardness |
Measures how hard the material is that the item is made of. | |
typedef double | Thickness |
Measures how thick the item is. | |
typedef Entity::Health | Density |
Number of health points per unit of thickness. | |
Public Member Functions | |
virtual bool | attachObject (Object &object) |
Attach this item to an object. | |
virtual bool | detachObject () |
Detach this item from an object. | |
Object * | getObject () const |
Determine the object that this item is attached to. | |
Worth | getWorth () const |
Determine the worth of this item. | |
void | setWorth (Worth worth) |
Change the worth of this item. | |
Protected Member Functions | |
Item (Entity::Weight weight=0.0, Size::Type size=Size::MEDIUM, Worth worth=0.0) | |
Create a new item. | |
virtual bool | canEquip (const Object &object) const |
Determine if this item can be equipped by an object. |
|
Density is also used to calculate health of the item. |
|
Higher values indicate harder items that are harder to break. |
|
Thickness is used to calculate health of the item. Units of measure are locale-dependent. |
|
Units of measure are locale-dependent. |
|
This function is called when an item is equipped. If the item cannot be equipped, this function should return false. Derived classes should override this function if the item can affect the object when it is equipped.since it does not allow an item to be equipped by default.
Implements ogs::support::Attachable. |
|
Derived classes should override this function since it does not allow any item to be equipped.
|
|
This function is called when an item is unequipped. Derived classes should override this function since it always detaches an item from the object that equipped it.
Implements ogs::support::Attachable. |
|
When an item is equipped, it is attached to the object that equipped it. This function will return NULL if the item is not attached to any object.
Implements ogs::support::Attachable. |
|
|
|
Observers are notified of this change.
|