#include <MapHandler.hpp>
Public Types | |
enum | Depth { DEPTH_TOP = 0, DEPTH_ENTITY = 1, DEPTH_BRUSH = 2 } |
Depth within the .map file, used when loading and parsing the file. More... | |
Public Member Functions | |
MapHandler () | |
Constructor. | |
~MapHandler () | |
Destructor. | |
void | load (const std::string &filename) |
Load a MAP file. | |
void | compile () |
Compile to loaded .map. | |
void | save (const std::string &filename) |
Save the compilation result. | |
Private Member Functions | |
BrushFace * | loadBrushFace (char *pData, const Depth depth) |
Load a brush face. | |
void | loadProperty (const std::string &propertyDecl, const Depth depth, PropertyList &properties, EntityBase *&pParent) |
Load a property and add it to the last entity. | |
char * | skipSpaces (char *content) |
Skip useless spaces. | |
void | sortEntities () |
Sort the entities. | |
Private Attributes | |
std::vector < EntityBase * > | m_vpEntities |
Entities. |
Depth within the .map file, used when loading and parsing the file.
DEPTH_TOP | Top level of the .map file. |
DEPTH_ENTITY | Entity definition. |
DEPTH_BRUSH | Brush definition. |
syBR::map2syBR::MapHandler::MapHandler | ( | ) |
Constructor.
syBR::map2syBR::MapHandler::~MapHandler | ( | ) |
Destructor.
void syBR::map2syBR::MapHandler::load | ( | const std::string & | filename | ) |
Load a MAP file.
filename | Filename of the MAP file to load |
void syBR::map2syBR::MapHandler::compile | ( | ) |
Compile to loaded .map.
void syBR::map2syBR::MapHandler::save | ( | const std::string & | filename | ) |
Save the compilation result.
filename | Filename of the RLS file to save |
Load a brush face.
pData | ||
depth |
void syBR::map2syBR::MapHandler::loadProperty | ( | const std::string & | propertyDecl, | |
const Depth | depth, | |||
PropertyList & | properties, | |||
EntityBase *& | pParent | |||
) | [private] |
Load a property and add it to the last entity.
If the property is the class name then a new entity will be created of the specified type.
propertyDecl | Property declaration (e.g. "classname" "worldspawn") | |
depth | Current depth in the .map file | |
properties | List of properties of the last entity | |
pParent | Last entity |
char * syBR::map2syBR::MapHandler::skipSpaces | ( | char * | content | ) | [private] |
Skip useless spaces.
content | Pointer to a string whose leading spaces must be skipped |
void syBR::map2syBR::MapHandler::sortEntities | ( | ) | [private] |
Sort the entities.
std::vector<EntityBase *> syBR::map2syBR::MapHandler::m_vpEntities [private] |
Entities.
Copyright © 2008 by Sebastien Frippiat
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:34 2008