Handles a level terrain mod. This will parse and create an instance of Mercator::LevelTerrainMod, which is a mod which produces a level area in the landscape. The main parsing of the atlas data and creation of the terrain mod occurs in InnerTerrainMod_impl however, as this is a mod that uses templated shapes. More...
#include <TerrainMod.h>
Public Member Functions | |
InnerTerrainModLevel (TerrainMod &terrainMod) | |
Ctor. | |
virtual | ~InnerTerrainModLevel () |
Dtor. | |
virtual bool | parseAtlasData (const Atlas::Message::MapType &modElement) |
virtual Mercator::TerrainMod * | getModifier () |
Protected Attributes | |
InnerTerrainMod_impl * | mModifier_impl |
A reference to inner mod implementation. |
Handles a level terrain mod. This will parse and create an instance of Mercator::LevelTerrainMod, which is a mod which produces a level area in the landscape. The main parsing of the atlas data and creation of the terrain mod occurs in InnerTerrainMod_impl however, as this is a mod that uses templated shapes.
Eris::InnerTerrainModLevel::InnerTerrainModLevel | ( | TerrainMod & | terrainMod | ) |
Ctor.
terrainMod | The TerrainMod instance to which this instance belongs to. |
Mercator::TerrainMod * Eris::InnerTerrainModLevel::getModifier | ( | ) | [virtual] |
Accessor for the Mercator::TerrainMod created and held by this instance.
If no terrain mod could be created, such as with faulty Atlas data, or if parseAtlasData() hasn't been called yet, this will return a null pointer.
Implements Eris::InnerTerrainMod.
bool Eris::InnerTerrainModLevel::parseAtlasData | ( | const Atlas::Message::MapType & | modElement | ) | [virtual] |
Tries to parse the Atlas data.
It's up to the specific subclasses to provide proper parsing of the data depending on their needs. If the data is successfully parsed, a new Mercator::TerrainMod instance will be created.
modElement | The Atlas element describing the terrainmod. This should in most instances correspond directly to the "terrainmod" element found in the root atlas attribute map. |
Implements Eris::InnerTerrainMod.
A reference to inner mod implementation.
This is separate from this class because of the heavy use of templated shapes. The ownership is ours, so it will be destroyed when this instance is destroyed.