#include <src/orxonox/objects/pickup/items/Jump.h>
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. |
orxonox::Jump::Jump | ( | BaseObject * | creator | ) |
Constructor.
creator | Object that created this item. |
References jumpsAvailable_, RegisterObject, orxonox::MT_Type::Vector3, and velocity_.
orxonox::Jump::~Jump | ( | ) | [virtual] |
Deconstructor.
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.
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.
Referenced by XMLPort().
virtual int orxonox::Jump::getMaxCarryAmount | ( | ) | const [inline, virtual] |
Checks how many instances of this item can be carried at a time.
Reimplemented from orxonox::BaseItem.
const Vector3& orxonox::Jump::getVelocity | ( | ) | const [inline] |
bool orxonox::Jump::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::Jump::setJumpsAvailable | ( | int | num | ) | [inline] |
Set the amount of jumps available.
num | New number of available jumps. |
Referenced by XMLPort().
void orxonox::Jump::setVelocity | ( | const Vector3 & | velocity | ) | [inline] |
void orxonox::Jump::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::WorldEntity::getOrientation(), orxonox::MobileEntity::getVelocity(), jumpsAvailable_, orxonox::BaseItem::removeFrom(), orxonox::ControllableEntity::setVelocity(), and velocity_.
void orxonox::Jump::XMLPort | ( | Element & | xmlelement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
xmlelement | Element of the XML-file. | |
mode | XMLPort mode to use. |
Reimplemented from orxonox::BaseItem.
References getJumpsAvailable(), getVelocity(), setJumpsAvailable(), setVelocity(), SUPER, and XMLPortParam.
int orxonox::Jump::jumpsAvailable_ [private] |
Vector3 orxonox::Jump::velocity_ [private] |