map::ump::UMPFile Class Reference

#include <UMPFile.h>

Public Member Functions

 UMPFile (const std::string &fileName, const std::string &base="") throw (UMPException)
virtual ~UMPFile ()
bool load ()
bool save ()
const std::stringgetFileName () const
const std::stringgetBase () const
void addTile (UMPTile &tile)
UMPTilegetTileForMap (const std::string &map)
const std::string getMapName (const std::string &tile) const
const std::string getTileName (const std::string &map) const
void forEachTile (UMPTileVisitor &visitor) const

Private Types

typedef std::vector< UMPTile >
::iterator 
UMPTileIterator
typedef std::vector< UMPTile >
::const_iterator 
UMPTileConstIterator
typedef std::vector
< UMPAssembly >::iterator 
UMPAssemblyIterator
typedef std::vector
< UMPAssembly >
::const_iterator 
UMPAssemblyConstIterator

Private Member Functions

void parseTile (Tokeniser &tokeniser) throw (UMPException)
void parse (Tokeniser &tokenizer)

Private Attributes

std::string _fileName
std::string _base
std::vector< UMPTile_umpTiles
std::vector< UMPAssembly_umpAssenblies

Detailed Description

An ump file is a file that defines a theme for the RMA (random map assembly). It contains a list of UMPTiles objects that are part of the definition. Besides the tiles there are some UMPAssembly objects that defines a set of UMPTiles to be used for the assembling of the map. See http://ufoai.ninex.info/wiki/index.php/Mapping/Random_map_assembly/Algorithm

Definition at line 25 of file UMPFile.h.


Member Typedef Documentation

typedef std::vector<UMPAssembly>::const_iterator map::ump::UMPFile::UMPAssemblyConstIterator [private]

Definition at line 42 of file UMPFile.h.

typedef std::vector<UMPAssembly>::iterator map::ump::UMPFile::UMPAssemblyIterator [private]

Definition at line 41 of file UMPFile.h.

typedef std::vector<UMPTile>::const_iterator map::ump::UMPFile::UMPTileConstIterator [private]

Definition at line 37 of file UMPFile.h.

typedef std::vector<UMPTile>::iterator map::ump::UMPFile::UMPTileIterator [private]

Definition at line 36 of file UMPFile.h.


Constructor & Destructor Documentation

map::ump::UMPFile::UMPFile ( const std::string fileName,
const std::string base = "" 
) throw (UMPException)

Creates a new umpFile object

Parameters:
fileName The ump file to create or read
base The prefix for all ump tiles
virtual map::ump::UMPFile::~UMPFile (  )  [virtual]

Member Function Documentation

void map::ump::UMPFile::addTile ( UMPTile tile  ) 

Adds a new ump tile to the file

Parameters:
tile The tile to add
void map::ump::UMPFile::forEachTile ( UMPTileVisitor visitor  )  const [inline]

Visits each tile of this UMP file.

Parameters:
visitor visitor to invoke for each tile.

Definition at line 114 of file UMPFile.h.

References _umpTiles, and i.

const std::string& map::ump::UMPFile::getBase (  )  const
Returns:
The prefix for all ump tiles
const std::string& map::ump::UMPFile::getFileName (  )  const
Returns:
The filename of the ump file
const std::string map::ump::UMPFile::getMapName ( const std::string tile  )  const
Parameters:
tile The tile to get the map name for
Returns:
The map name that was assembled by the tile name and the base (if a base is set)
UMPTile* map::ump::UMPFile::getTileForMap ( const std::string map  ) 
Parameters:
map The name of the map to search the ump file for (base is handled automatically)
Returns:
NULL if not found, the tile pointer otherwise
const std::string map::ump::UMPFile::getTileName ( const std::string map  )  const

Converts the map name into a tile name when a base is set

Parameters:
map The map to get the tile name for
Returns:
The tile name that might be shorter if a base is set
bool map::ump::UMPFile::load (  ) 

Load the ump file

Returns:
true if the load was successful, false otherwise
void map::ump::UMPFile::parse ( Tokeniser tokenizer  )  [private]
void map::ump::UMPFile::parseTile ( Tokeniser tokeniser  )  throw (UMPException) [private]
Exceptions:
UMPException if tile could not get parsed
bool map::ump::UMPFile::save (  ) 

Save the ump file

Returns:
true if the save was successful, false otherwise

Field Documentation

Definition at line 32 of file UMPFile.h.

Definition at line 29 of file UMPFile.h.

Definition at line 40 of file UMPFile.h.

std::vector<UMPTile> map::ump::UMPFile::_umpTiles [private]

Definition at line 35 of file UMPFile.h.

Referenced by forEachTile().


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

Generated by  doxygen 1.6.2