syBR::map2syBR::MapHandler Class Reference

Class responsible for the compilation of a .map file into a syBR .scene file. More...

#include <MapHandler.hpp>

List of all members.

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

BrushFaceloadBrushFace (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.


Detailed Description

Class responsible for the compilation of a .map file into a syBR .scene file.

Member Enumeration Documentation

enum syBR::map2syBR::MapHandler::Depth

Depth within the .map file, used when loading and parsing the file.

Enumerator:
DEPTH_TOP  Top level of the .map file.
DEPTH_ENTITY  Entity definition.
DEPTH_BRUSH  Brush definition.


Constructor & Destructor Documentation

syBR::map2syBR::MapHandler::MapHandler (  ) 

Constructor.

syBR::map2syBR::MapHandler::~MapHandler (  ) 

Destructor.


Member Function Documentation

void syBR::map2syBR::MapHandler::load ( const std::string &  filename  ) 

Load a MAP file.

Parameters:
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.

Parameters:
filename Filename of the RLS file to save

BrushFace * syBR::map2syBR::MapHandler::loadBrushFace ( char *  pData,
const Depth  depth 
) [private]

Load a brush face.

Parameters:
pData 
depth 
Returns:

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.

Parameters:
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.

Parameters:
content Pointer to a string whose leading spaces must be skipped
Returns:
Pointer to the same string without any leading spaces

void syBR::map2syBR::MapHandler::sortEntities (  )  [private]

Sort the entities.


Member Data Documentation

std::vector<EntityBase *> syBR::map2syBR::MapHandler::m_vpEntities [private]

Entities.


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

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:34 2008