Orxonox: orxonox::Jump Class Reference

# orxonox::Jump Class Reference

Jump-item, enables player to "jump" into a direction. More...

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

Inheritance diagram for orxonox::Jump:

List of all members.

## Public Member Functions

virtual bool | dropped (Pawn *pawn)
| Called when the item is dropped.
int | getJumpsAvailable () const
| Get the amount of jumps available.
virtual int | getMaxCarryAmount () const
| Checks how many instances of this item can be carried at a time.
const Vector3 & | getVelocity () const
| Get the velocity added when the item is used.
| Jump (BaseObject *creator)
| Constructor.
virtual bool | pickedUp (Pawn *pawn)
| Called when the item is picked up.
void | setJumpsAvailable (int num)
| Set the amount of jumps available.
void | setVelocity (const Vector3 &velocity)
| Set the velocity added when the item is used.
virtual void | used (Pawn *pawn)
| Called when the item is used.
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| XMLPort.
virtual | ~Jump ()
| Deconstructor.

## Private Attributes

int | jumpsAvailable_
| Amount of jumps still available.
Vector3 | velocity_
| The velocity added when the item is used.

## Detailed Description

Jump-item, enables player to "jump" into a direction.

## Constructor & Destructor Documentation

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

Constructor.

Parameters:

  | creator | Object that created this item.

References jumpsAvailable_, RegisterObject, orxonox::MT_Type::Vector3, and velocity_.

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

Deconstructor.

## Member Function Documentation

bool orxonox::Jump::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().

int orxonox::Jump::getJumpsAvailable | ( |  | ) | const`[inline]`

Get the amount of jumps available.

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

Referenced by XMLPort().

virtual int orxonox::Jump::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.

const Vector3& orxonox::Jump::getVelocity | ( |  | ) | const`[inline]`

Get the velocity added when the item is used.

Returns:
  Returns the added velocity (relative to the Pawn).

Referenced by XMLPort().

bool orxonox::Jump::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::Jump::setJumpsAvailable | ( | int | num | ) | `[inline]`

Set the amount of jumps available.

Parameters:

  | num | New number of available jumps.

Referenced by XMLPort().

void orxonox::Jump::setVelocity | ( | const Vector3 & | velocity | ) | `[inline]`

Set the velocity added when the item is used.

Parameters:

  | velocity | New added velocity (relative to Pawn).

Referenced by XMLPort().

void orxonox::Jump::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::WorldEntity::getOrientation(), orxonox::MobileEntity::getVelocity(), jumpsAvailable_, orxonox::BaseItem::removeFrom(), orxonox::ControllableEntity::setVelocity(), and velocity_.

void orxonox::Jump::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 getJumpsAvailable(), getVelocity(), setJumpsAvailable(), setVelocity(), SUPER, and XMLPortParam.

## Member Data Documentation

int orxonox::Jump::jumpsAvailable_`[private]`

Amount of jumps still available.

Referenced by Jump(), and used().

Vector3 orxonox::Jump::velocity_`[private]`

The velocity added when the item is used.

Referenced by Jump(), and used().

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

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