30 #ifndef ERIS_TERRAINMODOBSERVER_H
31 #define ERIS_TERRAINMODOBSERVER_H
33 #include <sigc++/signal.h>
34 #include <Eris/Entity.h>
42 class TerrainModTranslator;
71 virtual bool init(
bool alwaysObserve =
false);
77 Mercator::TerrainMod*
getMod()
const;
bool hasAttr(const std::string &p) const
Checks whether an attribute exists.
Definition: Entity.cpp:124
sigc::connection observe(const std::string &attr, const AttrChangedSlot &aslot)
Setup an observer so that the specified slot is fired when the named attribue's value changes.
Definition: Entity.cpp:163
const Atlas::Message::Element & valueOfAttr(const std::string &attr) const
Gets the value of a named attribute.
Definition: Entity.cpp:104
virtual void observeEntity()
Sets up the previous three handler functions to be called when a change is made to the entity holding...
Definition: TerrainModObserver.cpp:126
Entity is a concrete (instantiable) class representing one game entity.
Definition: Entity.h:57
WFMath::Point< 3 > getPosition() const
Returns the Entity's position inside it's parent in the parent's local system coordinates.
Definition: Entity.h:631
Mercator::TerrainMod * getMod() const
Used to retrieve a pointer to this modifier.
Definition: TerrainModObserver.cpp:52
TerrainModTranslator * mInnerMod
The inner terrain mod instance which holds the actual Mercator::TerrainMod instance and handles the p...
Definition: TerrainModObserver.h:162
sigc::slot< void, const Atlas::Message::Element & > AttrChangedSlot
A slot which can be used for receiving attribute update signals.
Definition: Entity.h:106
virtual void onModDeleted()
Called before the ModDeleted signal is emitted.
Definition: TerrainModObserver.cpp:142
Definition: LogStream.h:55
Wrapper class that envelopes a Mercator::TerrainMod. This class is mainly responsible for parsing atl...
Definition: TerrainModObserver.h:52
TerrainModObserver(Entity *entity)
Ctor.
Definition: TerrainModObserver.cpp:41
sigc::signal< void > BeingDeleted
Emitted prior to deletion.
Definition: Entity.h:333
const WFMath::Quaternion & getOrientation(void) const
Returns the entity's orientation as last set explicitely.
Definition: Entity.h:642
void entity_Deleted()
Called whenever the entity holding a modifier is deleted and handles removing the mod from the terrai...
Definition: TerrainModObserver.cpp:120
Entity * mEntity
The owner of this modifier.
Definition: TerrainModObserver.h:103
virtual void onModChanged()
Called before the ModChanged signal is emitted.
Definition: TerrainModObserver.cpp:147
virtual void reparseMod()
If an existing mod changes we need to reparse it.
Definition: TerrainModObserver.cpp:93
Entity * getEntity() const
Accessor for the entity to which this terrain mod belongs.
Definition: TerrainModObserver.cpp:137
Entity::AttrChangedSlot mAttrChangedSlot
Slot used to listen for changes to attributes in the Entity to which this mod belongs to.
Definition: TerrainModObserver.h:108
sigc::signal< void > Moved
Emitted when then entity's position, orientation or velocity change.
Definition: Entity.h:279
bool parseData(const WFMath::Point< 3 > &pos, const WFMath::Quaternion &, const Atlas::Message::MapType &)
Parse the Atlas data and create the terrain mod instance with it.
Definition: TerrainModTranslator.cpp:91
sigc::signal< void > ModDeleted
Emitted just before the entity owning this mod is deleted.
Definition: TerrainModObserver.h:90
void attributeChanged(const Atlas::Message::Element &attributeValue)
Called whenever a modifier is changed and handles the update.
Definition: TerrainModObserver.cpp:110
virtual bool parseMod()
Parses the Atlas data for a modifier.
Definition: TerrainModObserver.cpp:69
Mercator::TerrainMod * getModifier()
Accessor for the Mercator::TerrainMod created and held by this instance.
Definition: TerrainModTranslator.cpp:128
void entity_Moved()
Called whenever a modifier is moved and handles the update.
Definition: TerrainModObserver.cpp:115
Base class for all terrain mod specific classes.This is not meant to be used directly by anything els...
Definition: TerrainModTranslator.h:48
virtual ~TerrainModObserver()
Dtor.
Definition: TerrainModObserver.cpp:48
virtual bool init(bool alwaysObserve=false)
Sets up the observation of the entity, and parses the mod info, creating the initial mod instance.
Definition: TerrainModObserver.cpp:60
sigc::signal< void > ModChanged
Emitted whenever the modifier is changed or moved.
Definition: TerrainModObserver.h:84