#include <src/orxonox/objects/pickup/items/HealthUsable.h>
Public Member Functions | |
virtual bool | dropped (Pawn *pawn) |
Called when the item is dropped. | |
virtual int | getMaxCarryAmount () const |
Checks how many instances of this item can be carried at a time. | |
float | getRecoveredHealth () const |
Get the amount of jumps available. | |
HealthUsable (BaseObject *creator) | |
Constructor. | |
virtual bool | pickedUp (Pawn *pawn) |
Called when the item is picked up. | |
void | setRecoveredHealth (float recovery) |
Set the amount of jumps available. | |
virtual void | used (Pawn *pawn) |
Called when the item is used. | |
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode) |
XMLPort. | |
virtual | ~HealthUsable () |
Deconstructor. | |
Private Attributes | |
float | recoveredHealth_ |
Amount of jumps still available. |
orxonox::HealthUsable::HealthUsable | ( | BaseObject * | creator | ) |
Constructor.
creator | Object that created this item. |
References recoveredHealth_, and RegisterObject.
orxonox::HealthUsable::~HealthUsable | ( | ) | [virtual] |
Deconstructor.
bool orxonox::HealthUsable::dropped | ( | Pawn * | pawn | ) | [virtual] |
Called when the item is dropped.
Called when the item is dropped, creates a DroppedItem behind the pawn.
pawn | Pawn which dropped the item. |
Reimplemented from orxonox::BaseItem.
References orxonox::MT_Type::ColourValue, orxonox::DroppedItem::createDefaultDrop(), and orxonox::BaseItem::removeFrom().
virtual int orxonox::HealthUsable::getMaxCarryAmount | ( | ) | const [inline, virtual] |
Checks how many instances of this item can be carried at a time.
Reimplemented from orxonox::BaseItem.
float orxonox::HealthUsable::getRecoveredHealth | ( | ) | const [inline] |
Get the amount of jumps available.
Referenced by XMLPort().
bool orxonox::HealthUsable::pickedUp | ( | Pawn * | pawn | ) | [virtual] |
Called when the item is picked up.
pawn | Pawn which picked up the item. |
Reimplemented from orxonox::BaseItem.
References orxonox::BaseItem::addTo().
void orxonox::HealthUsable::setRecoveredHealth | ( | float | recovery | ) | [inline] |
Set the amount of jumps available.
num | New number of available jumps. |
Referenced by XMLPort().
void orxonox::HealthUsable::used | ( | Pawn * | pawn | ) | [virtual] |
Called when the item is used.
Called when the item is used, makes the user "jump".
pawn | Pawn which used te item. |
Reimplemented from orxonox::UsableItem.
References orxonox::Pawn::addHealth(), orxonox::Pawn::getHealth(), orxonox::Pawn::getMaxHealth(), recoveredHealth_, and orxonox::BaseItem::removeFrom().
void orxonox::HealthUsable::XMLPort | ( | Element & | xmlelement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
xmlelement | Element of the XML-file. | |
mode | XMLPort mode to use. |
Reimplemented from orxonox::BaseItem.
References getRecoveredHealth(), setRecoveredHealth(), SUPER, and XMLPortParam.
float orxonox::HealthUsable::recoveredHealth_ [private] |