orxonox::BaseObject Class Reference
The BaseObject is the parent of all classes representing an instance in the game. More...
#include <core/BaseObject.h>
Public Member Functions | |
| BaseObject (BaseObject *creator) | |
| Constructor: Registers the object in the BaseObject-list. | |
| virtual | ~BaseObject () |
| Destructor. | |
| void | addEventListener (BaseObject *listener) |
| Adds an object which listens to the events of this object. | |
| void | addEventSource (BaseObject *source, const std::string &state) |
| Adds a new event source for a specific state. | |
| void | addTemplate (Template *temp) |
| Adds a Template to the object. | |
| void | addTemplate (const std::string &name) |
| Adds a Template to the object. | |
| virtual void | changedActivity () |
| This function gets called if the activity of the object changes. | |
| virtual void | changedGametype () |
| virtual void | changedLevel () |
| virtual void | changedMainStateName () |
| This function gets called if the main state name of the object changes. | |
| virtual void | changedName () |
| This function gets called if the name of the object changes. | |
| virtual void | changedVisibility () |
| This function gets called if the visibility of the object changes. | |
| void | fireEvent (Event &event) |
| Fires an event, using the Event struct. | |
| void | fireEvent (bool activate, BaseObject *originator, const std::string &name="") |
| Fires an event which activates or deactivates a state with agiven originator (the object which triggered the event). | |
| void | fireEvent (bool activate, const std::string &name="") |
| Fires an event which activates or deactivates a state. | |
| void | fireEvent (const std::string &name="") |
| Fires an event (without a state). | |
| BaseObject * | getCreator () const |
| BaseObject * | getEventListener (unsigned int index) const |
| Returns an event listener with a given index. | |
| BaseObject * | getEventSource (unsigned int index, const std::string &state) const |
| Returns an eventsource with a given index. | |
| const XMLFile * | getFile () const |
| Returns a pointer to the XMLFile that loaded this object. | |
| const std::string & | getFilename () const |
| Returns the levelfile that loaded this object. | |
| const SmartPtr< Gametype > & | getGametype () const |
| const SmartPtr< Level > & | getLevel () const |
| const std::string & | getLoaderIndentation () const |
| Returns the indentation of the debug output in the Loader. | |
| const std::string & | getMainStateName () const |
| Returns the name of the main state. | |
| const std::string & | getName () const |
| Returns the name of the object. | |
| Namespace * | getNamespace () const |
| Gametype * | getOldGametype () const |
| const std::string & | getOldName () const |
| Returns the old name of the object. | |
| const SmartPtr< Scene > & | getScene () const |
| virtual uint32_t | getSceneID () const |
| const std::set< Template * > & | getTemplates () const |
| Returns the set of all aplied templates. | |
| const mbool & | isActive () const |
| Returns the state of the objects activity. | |
| bool | isInitialized () const |
| Returns if the object was initialized (passed the object registration). | |
| const mbool & | isVisible () const |
| Returns the state of the objects visibility. | |
| virtual void | processEvent (Event &event) |
| Processing an event by calling the right main state. | |
| void | removeEventSource (BaseObject *source) |
| Removes an eventsource (but doesn't unregister itself at the source). | |
| void | setActive (bool bActive) |
| Sets the state of the objects activity. | |
| void | setCreator (BaseObject *creator) |
| void | setFile (const XMLFile *file) |
| Sets a pointer to the xml file that loaded this object. | |
| void | setGametype (const SmartPtr< Gametype > &gametype) |
| void | setLevel (const SmartPtr< Level > &level) |
| void | setLoaderIndentation (const std::string &indentation) |
| Sets the indentation of the debug output in the Loader. | |
| void | setMainState (bool state) |
| Sets the main state of the object to a given boolean value. | |
| void | setMainStateName (const std::string &name) |
| Sets the name of the main state (used for event reactions). | |
| void | setName (const std::string &name) |
| Sets the name of the object. | |
| virtual void | setNamespace (Namespace *ns) |
| void | setScene (const SmartPtr< Scene > &scene, uint32_t sceneID) |
| void | setVisible (bool bVisible) |
| Sets the state of the objects visibility. | |
| virtual void | XMLEventPort (Element &xmlelement, XMLPort::Mode mode) |
| Defines the possible event states of this object and parses eventsources from an XML file. | |
| virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode) |
| XML loading and saving. | |
Static Public Member Functions | |
| static void | loadAllEventStates (Element &xmlelement, XMLPort::Mode mode, BaseObject *object, Identifier *identifier) |
| Manually loads all event states, even if the class doesn't officially support them. | |
Protected Member Functions | |
| void | addEventState (const std::string &name, EventState *container) |
| Adds a new event-state to the object. | |
| EventState * | getEventState (const std::string &name) const |
| Returns the event-state with the given name. | |
Protected Attributes | |
| mbool | bActive_ |
| True = the object is active. | |
| mbool | bVisible_ |
| True = the object is visible. | |
| FunctorPtr | mainStateFunctor_ |
| std::string | mainStateName_ |
| std::string | name_ |
| The name of the object. | |
| std::set< std::string > | networkTemplateNames_ |
| std::string | oldName_ |
| The old name of the object. | |
Private Member Functions | |
| const std::string & | getSingleTemplate (void) const |
| Returns the name of the first Template. | |
| Template * | getTemplate (unsigned int index) const |
| Returns the Template with the given index. | |
| void | registerEventListener (BaseObject *object) |
| Adds an object which listens to the events of this object. | |
| void | registerEventStates () |
| Calls XMLEventPort with an empty XML-element to register the event states if necessary. | |
| void | setXMLName (const std::string &name) |
| Loads the name of the object through XML and calls all XMLNameListener. | |
| void | unregisterEventListener (BaseObject *object) |
| Removes an event listener from this object. | |
Private Attributes | |
| bool | bInitialized_ |
| True if the object was initialized (passed the object registration). | |
| bool | bRegisteredEventStates_ |
| Becomes true after the object registered its event states (with XMLEventPort). | |
| BaseObject * | creator_ |
| std::set< BaseObject * > | eventListeners_ |
| List of objects which listen to the events of this object. | |
| std::set< BaseObject * > | eventListenersXML_ |
| List of objects which listen to the events of this object through the "eventlisteners" subsection in XML. | |
| std::map< BaseObject *, std::string > | eventSources_ |
| List of objects which send events to this object, mapped to the state which they affect. | |
| std::map< std::string, EventState * > | eventStates_ |
| Maps the name of the event states to their helper objects. | |
| const XMLFile * | file_ |
| The XMLFile that loaded this object. | |
| SmartPtr< Gametype > | gametype_ |
| Element * | lastLoadedXMLElement_ |
| Non 0 if the TinyXML attributes have already been copied to our own lowercase map. | |
| SmartPtr< Level > | level_ |
| std::string | loaderIndentation_ |
| Indentation of the debug output in the Loader. | |
| Namespace * | namespace_ |
| Gametype * | oldGametype_ |
| SmartPtr< Scene > | scene_ |
| uint32_t | sceneID_ |
| std::set< Template * > | templates_ |
| std::map< std::string, std::string > | xmlAttributes_ |
| Lowercase XML attributes. | |
Friends | |
| class | XMLPortClassParamContainer |
Detailed Description
The BaseObject is the parent of all classes representing an instance in the game.
Constructor & Destructor Documentation
| orxonox::BaseObject::BaseObject | ( | BaseObject * | creator | ) |
Constructor: Registers the object in the BaseObject-list.
| orxonox::BaseObject::~BaseObject | ( | ) | [virtual] |
Destructor.
Member Function Documentation
| void orxonox::BaseObject::addEventListener | ( | BaseObject * | listener | ) |
Adds an object which listens to the events of this object.
The events are sent to the other objects mainstate.
| void orxonox::BaseObject::addEventSource | ( | BaseObject * | source, | |
| const std::string & | state | |||
| ) |
Adds a new event source for a specific state.
- Parameters:
-
source The object which sends events to this object state The state of this object which will be affected by the events
| void orxonox::BaseObject::addEventState | ( | const std::string & | name, | |
| EventState * | state | |||
| ) | [protected] |
Adds a new event-state to the object.
Event-states are states which can be changed by events.
- Parameters:
-
name The name of the event state The object containing information about the event-state
| void orxonox::BaseObject::addTemplate | ( | Template * | temp | ) |
| void orxonox::BaseObject::addTemplate | ( | const std::string & | name | ) |
| virtual void orxonox::BaseObject::changedActivity | ( | void | ) | [inline, virtual] |
This function gets called if the activity of the object changes.
Reimplemented in orxonox::Attacher, orxonox::CheckPoint, orxonox::PortalEndPoint, orxonox::FadingBillboard, orxonox::ParticleEmitter, orxonox::WorldAmbientSound, orxonox::WorldSound, and orxonox::WorldEntity.
| virtual void orxonox::BaseObject::changedGametype | ( | ) | [inline, virtual] |
| virtual void orxonox::BaseObject::changedLevel | ( | ) | [inline, virtual] |
| void orxonox::BaseObject::changedMainStateName | ( | ) | [virtual] |
This function gets called if the main state name of the object changes.
| virtual void orxonox::BaseObject::changedName | ( | void | ) | [inline, virtual] |
This function gets called if the name of the object changes.
Reimplemented in orxonox::Template, orxonox::NotificationQueue, orxonox::NotificationQueueCEGUI, orxonox::HUDHealthBar, orxonox::PickupRepresentation, orxonox::PlayerInfo, and orxonox::OrxonoxOverlay.
| virtual void orxonox::BaseObject::changedVisibility | ( | void | ) | [inline, virtual] |
This function gets called if the visibility of the object changes.
Reimplemented in orxonox::Attacher, orxonox::Planet, orxonox::Trigger, orxonox::GUIOverlay, orxonox::HUDHealthBar, orxonox::Scoreboard, orxonox::BillboardProjectile, orxonox::ParticleProjectile, orxonox::Backlight, orxonox::Billboard, orxonox::FadingBillboard, orxonox::GlobalShader, orxonox::Light, orxonox::Model, orxonox::ParticleEmitter, orxonox::OrxonoxOverlay, orxonox::OverlayGroup, orxonox::Pawn, and orxonox::WorldEntity.
| void orxonox::BaseObject::fireEvent | ( | bool | activate, | |
| BaseObject * | originator, | |||
| const std::string & | name = "" | |||
| ) |
Fires an event which activates or deactivates a state with agiven originator (the object which triggered the event).
| void orxonox::BaseObject::fireEvent | ( | bool | activate, | |
| const std::string & | name = "" | |||
| ) |
Fires an event which activates or deactivates a state.
| void orxonox::BaseObject::fireEvent | ( | const std::string & | name = "" |
) |
Fires an event (without a state).
| BaseObject* orxonox::BaseObject::getCreator | ( | ) | const [inline] |
| BaseObject * orxonox::BaseObject::getEventListener | ( | unsigned int | index | ) | const |
Returns an event listener with a given index.
| BaseObject * orxonox::BaseObject::getEventSource | ( | unsigned int | index, | |
| const std::string & | state | |||
| ) | const |
Returns an eventsource with a given index.
| EventState * orxonox::BaseObject::getEventState | ( | const std::string & | name | ) | const [protected] |
Returns the event-state with the given name.
| const XMLFile* orxonox::BaseObject::getFile | ( | ) | const [inline] |
| const std::string & orxonox::BaseObject::getFilename | ( | ) | const |
Returns the levelfile that loaded this object.
- Returns:
- The levelfile
| const std::string& orxonox::BaseObject::getLoaderIndentation | ( | ) | const [inline] |
Returns the indentation of the debug output in the Loader.
- Returns:
- The indentation
| const std::string& orxonox::BaseObject::getMainStateName | ( | ) | const [inline] |
Returns the name of the main state.
| const std::string& orxonox::BaseObject::getName | ( | void | ) | const [inline] |
Returns the name of the object.
Reimplemented in orxonox::NotificationQueue.
| Namespace* orxonox::BaseObject::getNamespace | ( | ) | const [inline] |
| Gametype* orxonox::BaseObject::getOldGametype | ( | ) | const [inline] |
| const std::string& orxonox::BaseObject::getOldName | ( | ) | const [inline] |
Returns the old name of the object.
| virtual uint32_t orxonox::BaseObject::getSceneID | ( | ) | const [inline, virtual] |
Reimplemented in orxonox::Scene.
| const std::string & orxonox::BaseObject::getSingleTemplate | ( | void | ) | const [private] |
Returns the name of the first Template.
- Returns:
- The name as string.
| Template * orxonox::BaseObject::getTemplate | ( | unsigned int | index | ) | const [private] |
Returns the Template with the given index.
- Parameters:
-
index The index
| const std::set<Template*>& orxonox::BaseObject::getTemplates | ( | ) | const [inline] |
Returns the set of all aplied templates.
| const mbool& orxonox::BaseObject::isActive | ( | void | ) | const [inline] |
Returns the state of the objects activity.
- Returns:
- The state of the activity
Reimplemented in orxonox::MultiTrigger, orxonox::Trigger, and orxonox::TriggerBase.
| bool orxonox::BaseObject::isInitialized | ( | ) | const [inline] |
Returns if the object was initialized (passed the object registration).
- Returns:
- True was the object is initialized
Reimplemented in orxonox::Bot, orxonox::HumanPlayer, and orxonox::PlayerInfo.
| const mbool& orxonox::BaseObject::isVisible | ( | ) | const [inline] |
Returns the state of the objects visibility.
- Returns:
- The state of the visibility
| void orxonox::BaseObject::loadAllEventStates | ( | Element & | xmlelement, | |
| XMLPort::Mode | mode, | |||
| BaseObject * | object, | |||
| Identifier * | identifier | |||
| ) | [static] |
Manually loads all event states, even if the class doesn't officially support them.
This is needed by some classes like EventDispatcher or EventTarget.
| void orxonox::BaseObject::processEvent | ( | Event & | event | ) | [virtual] |
Processing an event by calling the right main state.
- Parameters:
-
event The event struct which contains the information about the event
Reimplemented in orxonox::Attacher, orxonox::EventDispatcher, orxonox::EventFilter, orxonox::EventListener, and orxonox::EventTarget.
| void orxonox::BaseObject::registerEventListener | ( | BaseObject * | object | ) | [private] |
Adds an object which listens to the events of this object.
| void orxonox::BaseObject::registerEventStates | ( | ) | [private] |
Calls XMLEventPort with an empty XML-element to register the event states if necessary.
| void orxonox::BaseObject::removeEventSource | ( | BaseObject * | source | ) |
Removes an eventsource (but doesn't unregister itself at the source).
| void orxonox::BaseObject::setActive | ( | bool | bActive | ) | [inline] |
Sets the state of the objects activity.
- Parameters:
-
bActive True = active
Reimplemented in orxonox::QuestEffectBeacon.
| void orxonox::BaseObject::setCreator | ( | BaseObject * | creator | ) | [inline] |
| void orxonox::BaseObject::setFile | ( | const XMLFile * | file | ) | [inline] |
Sets a pointer to the xml file that loaded this object.
- Parameters:
-
file The pointer to the XMLFile
| void orxonox::BaseObject::setLoaderIndentation | ( | const std::string & | indentation | ) | [inline] |
Sets the indentation of the debug output in the Loader.
- Parameters:
-
indentation The indentation
| void orxonox::BaseObject::setMainState | ( | bool | state | ) |
Sets the main state of the object to a given boolean value.
Note: The main state of an object can be set with the setMainStateName function. It's part of the eventsystem and used for event forwarding (when the target object can't specify a specific state, the main state is used by default).
| void orxonox::BaseObject::setMainStateName | ( | const std::string & | name | ) | [inline] |
Sets the name of the main state (used for event reactions).
| void orxonox::BaseObject::setName | ( | const std::string & | name | ) | [inline] |
| virtual void orxonox::BaseObject::setNamespace | ( | Namespace * | ns | ) | [inline, virtual] |
| void orxonox::BaseObject::setVisible | ( | bool | bVisible | ) | [inline] |
Sets the state of the objects visibility.
- Parameters:
-
bVisible True = visible
| void orxonox::BaseObject::setXMLName | ( | const std::string & | name | ) | [private] |
Loads the name of the object through XML and calls all XMLNameListener.
- Parameters:
-
name The name of the object
| void orxonox::BaseObject::unregisterEventListener | ( | BaseObject * | object | ) | [inline, private] |
Removes an event listener from this object.
| void orxonox::BaseObject::XMLEventPort | ( | Element & | xmlelement, | |
| XMLPort::Mode | mode | |||
| ) | [virtual] |
Defines the possible event states of this object and parses eventsources from an XML file.
- Parameters:
-
xmlelement The XML-element mode The mode defines the operation that is being executed: loading or saving the object (from or to XML respectively)
Reimplemented in orxonox::Dock, orxonox::NotificationDispatcher, orxonox::Script, orxonox::EventMultiTrigger, orxonox::EventTrigger, orxonox::PortalEndPoint, orxonox::QuestEffectBeacon, orxonox::ParticleSpawner, orxonox::WorldAmbientSound, and orxonox::WorldSound.
| void orxonox::BaseObject::XMLPort | ( | Element & | xmlelement, | |
| XMLPort::Mode | mode | |||
| ) | [virtual] |
XML loading and saving.
- Parameters:
-
xmlelement The XML-element mode The mode defines the operation that is being executed: loading or saving the object (from or to XML respectively)
Reimplemented in orxonox::Namespace, orxonox::Template, orxonox::ResourceCollection, orxonox::ResourceLocation, orxonox::CreateStars, orxonox::Dock, orxonox::DockingTarget, orxonox::DockToShip, orxonox::OldRaceCheckPoint, orxonox::RaceCheckPoint, orxonox::SpaceRaceController, orxonox::SpaceRaceManager, orxonox::CommandNotification, orxonox::SimpleNotification, orxonox::NotificationDispatcher, orxonox::NotificationQueue, orxonox::NotificationQueueCEGUI, orxonox::Attacher, orxonox::BoxCollisionShape, orxonox::ConeCollisionShape, orxonox::PlaneCollisionShape, orxonox::SphereCollisionShape, orxonox::EventDispatcher, orxonox::EventFilter, orxonox::EventListener, orxonox::EventTarget, orxonox::ForceField, orxonox::Planet, orxonox::Script, orxonox::SpaceBoundaries, orxonox::CheckPoint, orxonox::DistanceMultiTrigger, orxonox::DistanceTrigger, orxonox::EventMultiTrigger, orxonox::MultiTrigger, orxonox::Trigger, orxonox::TriggerBase, orxonox::Turret, orxonox::FadeoutText, orxonox::GUIOverlay, orxonox::BarColour, orxonox::HUDBar, orxonox::HUDHealthBar, orxonox::HUDNavigation, orxonox::HUDRadar, orxonox::LastManStandingInfos, orxonox::LastTeamStandingInfos, orxonox::TeamBaseMatchScore, orxonox::OverlayText, orxonox::DamageBoostPickup, orxonox::DronePickup, orxonox::HealthPickup, orxonox::InvisiblePickup, orxonox::MetaPickup, orxonox::ShieldPickup, orxonox::ShrinkPickup, orxonox::SpeedPickup, orxonox::Pickup, orxonox::PickupCollection, orxonox::PickupRepresentation, orxonox::PickupSpawner, orxonox::PongCenterpoint, orxonox::PongScore, orxonox::PortalEndPoint, orxonox::PortalLink, orxonox::AddQuest, orxonox::AddQuestHint, orxonox::AddReward, orxonox::ChangeQuestStatus, orxonox::CompleteQuest, orxonox::FailQuest, orxonox::GlobalQuest, orxonox::LocalQuest, orxonox::Quest, orxonox::QuestDescription, orxonox::QuestEffectBeacon, orxonox::QuestHint, orxonox::QuestItem, orxonox::QuestListener, orxonox::TetrisCenterpoint, orxonox::TetrisScore, orxonox::TowerDefenseCenterpoint, orxonox::TowerDefenseController, orxonox::TowerDefenseHUDController, orxonox::EnergyDrink, orxonox::HsW01, orxonox::CollisionShape, orxonox::CompoundCollisionShape, orxonox::ArtificialController, orxonox::FormationController, orxonox::WaypointPatrolController, orxonox::AnimatedModel, orxonox::Backlight, orxonox::Billboard, orxonox::BlinkingBillboard, orxonox::FadingBillboard, orxonox::GlobalShader, orxonox::Light, orxonox::MeshLodInformation, orxonox::Model, orxonox::ParticleEmitter, orxonox::ParticleSpawner, orxonox::Engine, orxonox::MultiStateEngine, orxonox::Level, orxonox::LevelInfo, orxonox::GUISheet, orxonox::OrxonoxOverlay, orxonox::OverlayGroup, orxonox::Scene, orxonox::WorldAmbientSound, orxonox::WorldSound, orxonox::DefaultWeaponmodeLink, orxonox::Weapon, orxonox::WeaponMode, orxonox::WeaponPack, orxonox::WeaponSet, orxonox::CameraPosition, orxonox::ControllableEntity, orxonox::Drone, orxonox::EffectContainer, orxonox::MobileEntity, orxonox::MovableEntity, orxonox::FpsPlayer, orxonox::Pawn, orxonox::SpaceShip, orxonox::SpawnPoint, orxonox::TeamSpawnPoint, and orxonox::WorldEntity.
Friends And Related Function Documentation
friend class XMLPortClassParamContainer [friend] |
Member Data Documentation
mbool orxonox::BaseObject::bActive_ [protected] |
True = the object is active.
Reimplemented in orxonox::EventFilter, orxonox::EventListener, orxonox::EventTarget, and orxonox::Trigger.
bool orxonox::BaseObject::bInitialized_ [private] |
True if the object was initialized (passed the object registration).
bool orxonox::BaseObject::bRegisteredEventStates_ [private] |
Becomes true after the object registered its event states (with XMLEventPort).
mbool orxonox::BaseObject::bVisible_ [protected] |
True = the object is visible.
BaseObject* orxonox::BaseObject::creator_ [private] |
std::set<BaseObject*> orxonox::BaseObject::eventListeners_ [private] |
List of objects which listen to the events of this object.
std::set<BaseObject*> orxonox::BaseObject::eventListenersXML_ [private] |
List of objects which listen to the events of this object through the "eventlisteners" subsection in XML.
std::map<BaseObject*, std::string> orxonox::BaseObject::eventSources_ [private] |
List of objects which send events to this object, mapped to the state which they affect.
std::map<std::string, EventState*> orxonox::BaseObject::eventStates_ [private] |
Maps the name of the event states to their helper objects.
const XMLFile* orxonox::BaseObject::file_ [private] |
The XMLFile that loaded this object.
SmartPtr<Gametype> orxonox::BaseObject::gametype_ [private] |
Reimplemented in orxonox::Level.
Element* orxonox::BaseObject::lastLoadedXMLElement_ [private] |
Non 0 if the TinyXML attributes have already been copied to our own lowercase map.
SmartPtr<Level> orxonox::BaseObject::level_ [private] |
Indentation of the debug output in the Loader.
FunctorPtr orxonox::BaseObject::mainStateFunctor_ [protected] |
std::string orxonox::BaseObject::mainStateName_ [protected] |
std::string orxonox::BaseObject::name_ [protected] |
The name of the object.
Reimplemented in orxonox::PickupRepresentation.
Namespace* orxonox::BaseObject::namespace_ [private] |
std::set<std::string> orxonox::BaseObject::networkTemplateNames_ [protected] |
Gametype* orxonox::BaseObject::oldGametype_ [private] |
std::string orxonox::BaseObject::oldName_ [protected] |
The old name of the object.
SmartPtr<Scene> orxonox::BaseObject::scene_ [private] |
uint32_t orxonox::BaseObject::sceneID_ [private] |
std::set<Template*> orxonox::BaseObject::templates_ [private] |
std::map<std::string, std::string> orxonox::BaseObject::xmlAttributes_ [private] |
Lowercase XML attributes.
The documentation for this class was generated from the following files:
- libraries/core/BaseObject.h
- libraries/core/BaseObject.cc
Generated on Tue May 21 06:35:06 2013 for Orxonox by
1.6.3








