orxonox::BaseObject Class Reference

The BaseObject is the parent of all classes representing an instance in the game. More...

#include <src/core/BaseObject.h>

Inheritance diagram for orxonox::BaseObject:

orxonox::OrxonoxClass orxonox::BarColour orxonox::BaseItem orxonox::CollisionShape orxonox::Controller orxonox::DefaultWeaponmodeLink orxonox::EventDispatcher orxonox::EventListener orxonox::EventTarget orxonox::Gametype orxonox::GlobalShader orxonox::Info orxonox::Item orxonox::Level orxonox::Munition orxonox::Namespace orxonox::Notification orxonox::OrxonoxOverlay orxonox::OverlayGroup orxonox::QuestDescription orxonox::QuestEffect orxonox::QuestItem orxonox::QuestListener orxonox::Scene orxonox::Script orxonox::Template orxonox::Test orxonox::WeaponMode orxonox::WeaponPack orxonox::WeaponSet orxonox::WeaponSystem orxonox::WorldEntity

List of all members.

Public Member Functions

void addEvent (BaseObject *event, const std::string &sectionname)
void addEventContainer (const std::string &sectionname, EventContainer *container)
void addTemplate (Template *temp)
 Adds a Template to the object.
void addTemplate (const std::string &name)
 Adds a Template to the object.
 BaseObject (BaseObject *creator)
 Constructor: Registers the object in the BaseObject-list.
virtual void changedActivity ()
 This function gets called if the activity of the object changes.
virtual void changedGametype ()
virtual void changedMainState ()
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)
void fireEvent (bool activate, BaseObject *originator)
void fireEvent (bool activate)
void fireEvent ()
BaseObjectgetCreator () const
BaseObjectgetEvent (unsigned int index) const
EventContainergetEventContainer (const std::string &sectionname) const
const XMLFilegetFile () const
 Returns a pointer to the XMLFile that loaded this object.
const std::stringgetFilename () const
 Returns the levelfile that loaded this object.
GametypegetGametype () const
const std::stringgetLoaderIndentation () const
 Returns the indentation of the debug output in the Loader.
bool getMainState () const
const std::stringgetMainStateName () const
const std::stringgetName () const
 Returns the name of the object.
NamespacegetNamespace () const
GametypegetOldGametype () const
const std::stringgetOldName () const
 Returns the old name of the object.
ScenegetScene () const
const std::set< Template * > & getTemplates () const
 Returns the set of all aplied templates.
const mboolisActive () const
 Returns the state of the objects activity.
bool isInitialized () const
 Returns if the object was initialized (passed the object registration).
const mboolisVisible () const
 Returns the state of the objects visibility.
virtual void processEvent (Event &event)
void registerEventListener (BaseObject *object, const std::string &sectionname)
void removeEvent (BaseObject *event)
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 (Gametype *gametype)
void setLoaderIndentation (const std::string &indentation)
 Sets the indentation of the debug output in the Loader.
void setMainState (bool state)
void setMainStateName (const std::string &name)
void setName (const std::string &name)
 Sets the name of the object.
virtual void setNamespace (Namespace *ns)
void setScene (Scene *scene)
void setVisible (bool bVisible)
 Sets the state of the objects visibility.
void unregisterEventListener (BaseObject *object)
virtual void XMLPort (Element &xmlelement, XMLPort::Mode mode)
 XML loading and saving.
virtual ~BaseObject ()
 Destructor.

Protected Attributes

mbool bActive_
 True = the object is active.
mbool bVisible_
 True = the object is visible.
FunctorfunctorGetMainState_
FunctorfunctorSetMainState_
std::string mainStateName_
std::string name_
 The name of the object.
std::string oldName_
 The old name of the object.

Private Member Functions

TemplategetTemplate (unsigned int index) const
 Returns the Template with the given index.
void setXMLName (const std::string &name)
 Loads the name of the object through XML and calls all XMLNameListener.

Private Attributes

bool bInitialized_
 True if the object was initialized (passed the object registration).
BaseObjectcreator_
std::map< std::string,
EventContainer * > 
eventContainers_
std::map< BaseObject
*, std::string
eventListeners_
std::list< BaseObject * > events_
const XMLFilefile_
 The XMLFile that loaded this object.
Gametypegametype_
Element * lastLoadedXMLElement_
 Non 0 if the TinyXML attributes have already been copied to our own lowercase map.
std::string loaderIndentation_
 Indentation of the debug output in the Loader.
Namespacenamespace_
GametypeoldGametype_
Scenescene_
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  ) 

orxonox::BaseObject::~BaseObject (  )  [virtual]


Member Function Documentation

void orxonox::BaseObject::addEvent ( BaseObject event,
const std::string sectionname 
)

References events_.

Referenced by XMLPort().

void orxonox::BaseObject::addEventContainer ( const std::string sectionname,
EventContainer container 
)

void orxonox::BaseObject::addTemplate ( Template temp  ) 

Adds a Template to the object.

Parameters:
temp The Template

References orxonox::Template::applyOn(), and templates_.

void orxonox::BaseObject::addTemplate ( const std::string name  ) 

virtual void orxonox::BaseObject::changedActivity (  )  [inline, virtual]

This function gets called if the activity of the object changes.

Reimplemented in orxonox::Engine, orxonox::PickupSpawner, orxonox::Attacher, orxonox::FadingBillboard, orxonox::ParticleEmitter, and orxonox::CheckPoint.

Referenced by orxonox::WorldEntity::registerVariables().

virtual void orxonox::BaseObject::changedGametype (  )  [inline, virtual]

void orxonox::BaseObject::changedMainState (  )  [virtual]

virtual void orxonox::BaseObject::changedName (  )  [inline, virtual]

This function gets called if the name of the object changes.

Reimplemented in orxonox::Template, orxonox::EventTarget, orxonox::PlayerInfo, orxonox::HUDHealthBar, and orxonox::OrxonoxOverlay.

Referenced by orxonox::Level::registerVariables().

virtual void orxonox::BaseObject::changedVisibility (  )  [inline, virtual]

void orxonox::BaseObject::fireEvent ( Event event  ) 

References eventListeners_.

void orxonox::BaseObject::fireEvent ( bool  activate,
BaseObject originator 
)

References eventListeners_.

void orxonox::BaseObject::fireEvent ( bool  activate  ) 

References fireEvent().

void orxonox::BaseObject::fireEvent (  ) 

BaseObject* orxonox::BaseObject::getCreator (  )  const [inline]

BaseObject * orxonox::BaseObject::getEvent ( unsigned int  index  )  const

References events_.

Referenced by XMLPort().

EventContainer * orxonox::BaseObject::getEventContainer ( const std::string sectionname  )  const

References eventContainers_.

const XMLFile* orxonox::BaseObject::getFile (  )  const [inline]

Returns a pointer to the XMLFile that loaded this object.

Returns:
The XMLFile

Referenced by BaseObject().

const std::string & orxonox::BaseObject::getFilename (  )  const

Returns the levelfile that loaded this object.

Returns:
The levelfile

References orxonox::BLANKSTRING, file_, and orxonox::XMLFile::getFilename().

Referenced by orxonox::Level::Level(), and orxonox::XMLPortClassParamContainer< T >::port().

Gametype* orxonox::BaseObject::getGametype (  )  const [inline]

const std::string& orxonox::BaseObject::getLoaderIndentation (  )  const [inline]

Returns the indentation of the debug output in the Loader.

Returns:
The indentation

Referenced by orxonox::XMLPortClassParamContainer< T >::port().

bool orxonox::BaseObject::getMainState (  )  const

const std::string& orxonox::BaseObject::getMainStateName (  )  const [inline]

Referenced by XMLPort().

const std::string& orxonox::BaseObject::getName (  )  const [inline]

Namespace* orxonox::BaseObject::getNamespace (  )  const [inline]

Gametype* orxonox::BaseObject::getOldGametype (  )  const [inline]

const std::string& orxonox::BaseObject::getOldName (  )  const [inline]

Scene* orxonox::BaseObject::getScene (  )  const [inline]

Template * orxonox::BaseObject::getTemplate ( unsigned int  index  )  const [private]

Returns the Template with the given index.

Parameters:
index The index

References templates_.

Referenced by XMLPort().

const std::set<Template*>& orxonox::BaseObject::getTemplates (  )  const [inline]

Returns the set of all aplied templates.

const mbool& orxonox::BaseObject::isActive ( void   )  const [inline]

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.

Referenced by orxonox::Planet::changedVisibility(), orxonox::Backlight::~Backlight(), ~BaseObject(), orxonox::BigExplosion::~BigExplosion(), orxonox::Billboard::~Billboard(), orxonox::BillboardProjectile::~BillboardProjectile(), orxonox::BoxCollisionShape::~BoxCollisionShape(), orxonox::Camera::~Camera(), orxonox::CollisionShape::~CollisionShape(), orxonox::CompoundCollisionShape::~CompoundCollisionShape(), orxonox::ConeCollisionShape::~ConeCollisionShape(), orxonox::ControllableEntity::~ControllableEntity(), orxonox::Engine::~Engine(), orxonox::EventDispatcher::~EventDispatcher(), orxonox::ExplosionChunk::~ExplosionChunk(), orxonox::HUDBar::~HUDBar(), orxonox::HUDHealthBar::~HUDHealthBar(), orxonox::HUDNavigation::~HUDNavigation(), orxonox::HUDRadar::~HUDRadar(), orxonox::HumanPlayer::~HumanPlayer(), orxonox::Level::~Level(), orxonox::Light::~Light(), orxonox::Model::~Model(), orxonox::MovableEntity::~MovableEntity(), orxonox::MultiStateEngine::~MultiStateEngine(), orxonox::OrxonoxOverlay::~OrxonoxOverlay(), orxonox::OverlayText::~OverlayText(), orxonox::ParticleEmitter::~ParticleEmitter(), orxonox::ParticleProjectile::~ParticleProjectile(), orxonox::Pawn::~Pawn(), orxonox::PlaneCollisionShape::~PlaneCollisionShape(), orxonox::Planet::~Planet(), orxonox::PlayerInfo::~PlayerInfo(), orxonox::Scene::~Scene(), orxonox::SpaceShip::~SpaceShip(), orxonox::Spectator::~Spectator(), orxonox::SphereCollisionShape::~SphereCollisionShape(), orxonox::Stats::~Stats(), orxonox::UnderAttackHealthBar::~UnderAttackHealthBar(), orxonox::WaypointController::~WaypointController(), orxonox::Weapon::~Weapon(), orxonox::WeaponPack::~WeaponPack(), orxonox::WeaponSet::~WeaponSet(), orxonox::WeaponSlot::~WeaponSlot(), orxonox::WeaponSystem::~WeaponSystem(), and orxonox::WorldEntity::~WorldEntity().

const mbool& orxonox::BaseObject::isVisible (  )  const [inline]

void orxonox::BaseObject::processEvent ( Event event  )  [virtual]

void orxonox::BaseObject::registerEventListener ( BaseObject object,
const std::string sectionname 
) [inline]

void orxonox::BaseObject::removeEvent ( BaseObject event  ) 

References events_.

void orxonox::BaseObject::setActive ( bool  bActive  )  [inline]

void orxonox::BaseObject::setCreator ( BaseObject creator  )  [inline]

Referenced by BaseObject().

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

Referenced by BaseObject(), and orxonox::Loader::load().

void orxonox::BaseObject::setGametype ( Gametype gametype  )  [inline]

void orxonox::BaseObject::setLoaderIndentation ( const std::string indentation  )  [inline]

Sets the indentation of the debug output in the Loader.

Parameters:
indentation The indentation

Referenced by orxonox::Loader::load(), and orxonox::XMLPortClassObjectContainer< T, O >::port().

void orxonox::BaseObject::setMainState ( bool  state  ) 

void orxonox::BaseObject::setMainStateName ( const std::string name  ) 

void orxonox::BaseObject::setName ( const std::string name  )  [inline]

virtual void orxonox::BaseObject::setNamespace ( Namespace ns  )  [inline, virtual]

void orxonox::BaseObject::setScene ( Scene scene  )  [inline]

void orxonox::BaseObject::setVisible ( bool  bVisible  )  [inline]

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

References setName().

Referenced by XMLPort().

void orxonox::BaseObject::unregisterEventListener ( BaseObject object  )  [inline]

Referenced by ~BaseObject().

void orxonox::BaseObject::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 in orxonox::Namespace, orxonox::Template, orxonox::BoxCollisionShape, orxonox::CollisionShape, orxonox::CompoundCollisionShape, orxonox::ConeCollisionShape, orxonox::PlaneCollisionShape, orxonox::SphereCollisionShape, orxonox::WaypointController, orxonox::WaypointPatrolController, orxonox::EventDispatcher, orxonox::EventListener, orxonox::GlobalShader, orxonox::Engine, orxonox::MultiStateEngine, orxonox::Level, orxonox::BaseItem, orxonox::HealthImmediate, orxonox::HealthUsable, orxonox::Jump, orxonox::ModifierPickup, orxonox::PickupSpawner, 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::Scene, orxonox::Script, orxonox::DefaultWeaponmodeLink, orxonox::Weapon, orxonox::WeaponMode, orxonox::EnergyDrink, orxonox::HsW01, orxonox::WeaponPack, orxonox::WeaponSet, orxonox::WeaponSlot, orxonox::Attacher, orxonox::Backlight, orxonox::Billboard, orxonox::BlinkingBillboard, orxonox::CameraPosition, orxonox::ControllableEntity, orxonox::FadingBillboard, orxonox::ForceField, orxonox::Light, orxonox::MobileEntity, orxonox::Model, orxonox::MovableEntity, orxonox::ParticleEmitter, orxonox::ParticleSpawner, orxonox::Pawn, orxonox::SpaceShip, orxonox::Planet, orxonox::PongCenterpoint, orxonox::SpawnPoint, orxonox::TeamSpawnPoint, orxonox::CheckPoint, orxonox::DistanceTrigger, orxonox::PlayerTrigger, orxonox::Trigger, orxonox::WorldEntity, orxonox::FadeoutText, orxonox::GUIOverlay, orxonox::BarColour, orxonox::HUDBar, orxonox::HUDHealthBar, orxonox::HUDNavigation, orxonox::HUDRadar, orxonox::PongScore, orxonox::TeamBaseMatchScore, orxonox::UnderAttackHealthBar, orxonox::Map, orxonox::NotificationQueue, orxonox::OrxonoxOverlay, orxonox::OverlayGroup, orxonox::OverlayText, orxonox::Scoreboard, and orxonox::Stats.

References addEvent(), addTemplate(), orxonox::Identifier::addXMLPortEventContainer(), orxonox::createExecutor(), orxonox::XMLPort::ExpandObject, getEvent(), orxonox::OrxonoxClass::getIdentifier(), getMainStateName(), getName(), getTemplate(), orxonox::Identifier::getXMLPortEventContainer(), orxonox::Identifier::getXMLPortEventMapBegin(), orxonox::Identifier::getXMLPortEventMapEnd(), isActive(), isVisible(), orxonox::XMLPort::LoadObject, orxonox::XMLPortClassObjectContainer< T, O >::port(), orxonox::XMLPort::SaveObject, setActive(), orxonox::Executor::setDefaultValue(), setMainStateName(), setVisible(), setXMLName(), XMLPortObjectTemplate, and XMLPortParam.

Referenced by orxonox::XMLPortClassObjectContainer< T, O >::port(), and orxonox::Script::XMLPort().


Friends And Related Function Documentation

friend class XMLPortClassParamContainer [friend]


Member Data Documentation

True = the object is active.

Reimplemented in orxonox::EventListener, and orxonox::Trigger.

Referenced by BaseObject(), and orxonox::WorldEntity::registerVariables().

True if the object was initialized (passed the object registration).

Referenced by BaseObject().

Referenced by BaseObject().

Referenced by fireEvent(), and ~BaseObject().

The XMLFile that loaded this object.

Referenced by BaseObject(), and getFilename().

Reimplemented in orxonox::Level.

Referenced by BaseObject().

Non 0 if the TinyXML attributes have already been copied to our own lowercase map.

Referenced by BaseObject(), and orxonox::XMLPortClassParamContainer< T >::port().

Indentation of the debug output in the Loader.

Referenced by BaseObject().

Referenced by BaseObject().

The old name of the object.

Referenced by BaseObject().

Referenced by addTemplate(), and getTemplate().

Lowercase XML attributes.

Referenced by orxonox::XMLPortClassParamContainer< T >::port().


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

Generated on Tue Jul 28 16:22:21 2009 for Orxonox by  doxygen 1.5.6