Orxonox: orxonox::HealthUsable Class Reference

# orxonox::HealthUsable Class Reference

Health-item, enables player recover health when used. More...

`#include <src/orxonox/objects/pickup/items/HealthUsable.h>`

Inheritance diagram for orxonox::HealthUsable:

List of all members.

## 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.

## Detailed Description

Health-item, enables player recover health when used.

## Constructor & Destructor Documentation

orxonox::HealthUsable::HealthUsable | ( | BaseObject * | creator | ) |

Constructor.

Parameters:

  | creator | Object that created this item.

References recoveredHealth_, and RegisterObject.

orxonox::HealthUsable::~HealthUsable | ( |  | ) | `[virtual]`

Deconstructor.

## Member Function Documentation

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.

Parameters:

  | 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.

Returns:
  How many of this item can be carried.

Reimplemented from orxonox::BaseItem.

float orxonox::HealthUsable::getRecoveredHealth | ( |  | ) | const`[inline]`

Get the amount of jumps available.

Returns:
  Returns how many times the item can be used.

Referenced by XMLPort().

bool orxonox::HealthUsable::pickedUp | ( | Pawn * | pawn | ) | `[virtual]`

Called when the item is picked up.

Parameters:

  | 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.

Parameters:

  | 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".

Parameters:

  | 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]`

XMLPort.

XMLPort for Jump.

Parameters:

  | xmlelement | Element of the XML-file.
  | mode | XMLPort mode to use.

Reimplemented from orxonox::BaseItem.

References getRecoveredHealth(), setRecoveredHealth(), SUPER, and XMLPortParam.

## Member Data Documentation

float orxonox::HealthUsable::recoveredHealth_`[private]`

Amount of jumps still available.

Referenced by HealthUsable(), and used().

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

- src/orxonox/objects/pickup/items/HealthUsable.h
- src/orxonox/objects/pickup/items/HealthUsable.cc