#include <src/orxonox/objects/items/MultiStateEngine.h>
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_ |
orxonox::MultiStateEngine::MultiStateEngine | ( | BaseObject * | creator | ) |
References RegisterObject, registerVariables(), and state_.
orxonox::MultiStateEngine::~MultiStateEngine | ( | ) | [virtual] |
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 |
WorldEntity * orxonox::MultiStateEngine::getBoostEffect | ( | unsigned int | index | ) | const |
WorldEntity * orxonox::MultiStateEngine::getBrakeEffect | ( | unsigned int | index | ) | const |
WorldEntity * orxonox::MultiStateEngine::getForwardEffect | ( | unsigned int | index | ) | const |
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.
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.
xmlelement | The XML-element | |
loading | Loading (true) or saving (false) |
Reimplemented from orxonox::Engine.
References addActiveEffect(), addBoostEffect(), addBrakeEffect(), addForwardEffect(), getActiveEffect(), getBoostEffect(), getBrakeEffect(), getForwardEffect(), SUPER, and XMLPortObject.
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().