Orxonox: orxonox::MultiStateEngine Class Reference

# orxonox::MultiStateEngine Class Reference

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

Inheritance diagram for orxonox::MultiStateEngine:

List of all members.

## Public Member Functions

void | addActiveEffect (WorldEntity *effect)
void | addBoostEffect (WorldEntity *effect)
void | addBrakeEffect (WorldEntity *effect)
void | addForwardEffect (WorldEntity *effect)
virtual void | addToSpaceShip (SpaceShip *ship)
WorldEntity * | getActiveEffect (unsigned int index) const
WorldEntity * | getBoostEffect (unsigned int index) const
WorldEntity * | getBrakeEffect (unsigned int index) const
WorldEntity * | getForwardEffect (unsigned int index) const
| MultiStateEngine (BaseObject *creator)
void | registerVariables ()
virtual void | tick (float dt)
| Gets called every frame.
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| XML loading and saving.
virtual | ~MultiStateEngine ()

## Private Attributes

std::list< WorldEntity * > | activeEffects_
std::list< WorldEntity * > | boostEffects_
std::list< WorldEntity * > | brakeEffects_
std::list< WorldEntity * > | forwardEffects_
unsigned char | state_

## Constructor & Destructor Documentation

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

References RegisterObject, registerVariables(), and state_.

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

References activeEffects_, boostEffects_, brakeEffects_, forwardEffects_, orxonox::Engine::getShip(), and orxonox::BaseObject::isInitialized().

## Member Function Documentation

void orxonox::MultiStateEngine::addActiveEffect | ( | WorldEntity * | effect | ) |

References activeEffects_, orxonox::WorldEntity::attach(), and orxonox::Engine::getShip().

Referenced by XMLPort().

void orxonox::MultiStateEngine::addBoostEffect | ( | WorldEntity * | effect | ) |

References orxonox::WorldEntity::attach(), boostEffects_, and orxonox::Engine::getShip().

Referenced by XMLPort().

void orxonox::MultiStateEngine::addBrakeEffect | ( | WorldEntity * | effect | ) |

References orxonox::WorldEntity::attach(), brakeEffects_, and orxonox::Engine::getShip().

Referenced by XMLPort().

void orxonox::MultiStateEngine::addForwardEffect | ( | WorldEntity * | effect | ) |

References orxonox::WorldEntity::attach(), forwardEffects_, and orxonox::Engine::getShip().

Referenced by XMLPort().

void orxonox::MultiStateEngine::addToSpaceShip | ( | SpaceShip * | ship | ) | `[virtual]`

Reimplemented from orxonox::Engine.

References activeEffects_, orxonox::Engine::addToSpaceShip(), orxonox::WorldEntity::attach(), boostEffects_, brakeEffects_, and forwardEffects_.

WorldEntity * orxonox::MultiStateEngine::getActiveEffect | ( | unsigned int | index | ) | const

References activeEffects_.

Referenced by XMLPort().

WorldEntity * orxonox::MultiStateEngine::getBoostEffect | ( | unsigned int | index | ) | const

References boostEffects_.

Referenced by XMLPort().

WorldEntity * orxonox::MultiStateEngine::getBrakeEffect | ( | unsigned int | index | ) | const

References brakeEffects_.

Referenced by XMLPort().

WorldEntity * orxonox::MultiStateEngine::getForwardEffect | ( | unsigned int | index | ) | const

References forwardEffects_.

Referenced by XMLPort().

void orxonox::MultiStateEngine::registerVariables | ( |  | ) |

Reimplemented from orxonox::Engine.

References orxonox::Synchronisable::registerVariable(), state_, and orxonox::VariableDirection::ToServer.

Referenced by MultiStateEngine().

void orxonox::MultiStateEngine::tick | ( | float | dt | ) | `[virtual]`

Gets called every frame.

Parameters:

  | dt | The time since the last frame in seconds

Reimplemented from orxonox::Engine.

References activeEffects_, orxonox::ObjectDirection::Bidirectional, boostEffects_, brakeEffects_, orxonox::FORWARD_EFFECT_VELOCITY_THRESHOLD, forwardEffects_, orxonox::SpaceShip::getBoost(), orxonox::Engine::getDirection(), orxonox::MobileEntity::getLocalVelocity(), orxonox::Engine::getShip(), orxonox::GameMode::isMaster(), orxonox::Synchronisable::setObjectMode(), state_, orxonox::STATE_ACTIVE, orxonox::STATE_BOOST, orxonox::STATE_BRAKE, orxonox::STATE_FORWARD, SUPER, and orxonox::MT_Type::Vector3.

void orxonox::MultiStateEngine::XMLPort | ( | Element & | xmlelement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

XML loading and saving.

Parameters:

  | xmlelement | The XML-element
  | loading | Loading (true) or saving (false)

Returns:
  The XML-element

Reimplemented from orxonox::Engine.

References addActiveEffect(), addBoostEffect(), addBrakeEffect(), addForwardEffect(), getActiveEffect(), getBoostEffect(), getBrakeEffect(), getForwardEffect(), SUPER, and XMLPortObject.

## Member Data Documentation

std::list<WorldEntity*> orxonox::MultiStateEngine::activeEffects_`[private]`

Referenced by addActiveEffect(), addToSpaceShip(), getActiveEffect(), tick(), and ~MultiStateEngine().

std::list<WorldEntity*> orxonox::MultiStateEngine::boostEffects_`[private]`

Referenced by addBoostEffect(), addToSpaceShip(), getBoostEffect(), tick(), and ~MultiStateEngine().

std::list<WorldEntity*> orxonox::MultiStateEngine::brakeEffects_`[private]`

Referenced by addBrakeEffect(), addToSpaceShip(), getBrakeEffect(), tick(), and ~MultiStateEngine().

std::list<WorldEntity*> orxonox::MultiStateEngine::forwardEffects_`[private]`

Referenced by addForwardEffect(), addToSpaceShip(), getForwardEffect(), tick(), and ~MultiStateEngine().

unsigned char orxonox::MultiStateEngine::state_`[private]`

Reimplemented from orxonox::Synchronisable.

Referenced by MultiStateEngine(), registerVariables(), and tick().

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

- src/orxonox/objects/items/MultiStateEngine.h
- src/orxonox/objects/items/MultiStateEngine.cc