Pyrogenesis  trunk
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CMapGenerator Class Reference

Random map generator interface. More...

#include <MapGenerator.h>

Collaboration diagram for CMapGenerator:
Collaboration graph
[legend]

Public Member Functions

 CMapGenerator ()
 
 ~CMapGenerator ()
 
void GenerateMap (const VfsPath &scriptFile, const std::string &settings)
 Start the map generator thread. More...
 
int GetProgress ()
 Get status of the map generator thread. More...
 
shared_ptr< ScriptInterface::StructuredCloneGetResults ()
 Get random map data, according to this format: http://trac.wildfiregames.com/wiki/Random_Map_Generator_Internals#Dataformat. More...
 

Private Member Functions

 NONCOPYABLE (CMapGenerator)
 

Private Attributes

CMapGeneratorWorkerm_Worker
 

Detailed Description

Random map generator interface.

Initialized by CMapReader and then checked periodically during loading, until it's finished (progress value is 0).

The actual work is performed by CMapGeneratorWorker in a separate thread.

Constructor & Destructor Documentation

CMapGenerator::CMapGenerator ( )
CMapGenerator::~CMapGenerator ( )

Member Function Documentation

void CMapGenerator::GenerateMap ( const VfsPath scriptFile,
const std::string &  settings 
)

Start the map generator thread.

Parameters
scriptFileThe VFS path for the script, e.g. "maps/random/latium.js"
settingsJSON string containing settings for the map generator
int CMapGenerator::GetProgress ( )

Get status of the map generator thread.

Returns
Progress percentage 1-100 if active, 0 when finished, or -1 on error
shared_ptr< ScriptInterface::StructuredClone > CMapGenerator::GetResults ( )

Get random map data, according to this format: http://trac.wildfiregames.com/wiki/Random_Map_Generator_Internals#Dataformat.

Returns
StructuredClone containing map data
CMapGenerator::NONCOPYABLE ( CMapGenerator  )
private

Member Data Documentation

CMapGeneratorWorker* CMapGenerator::m_Worker
private

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