Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CMapGenerator Class Reference

Random map generator interface. More...

#include <MapGenerator.h>

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::StructuredClone
GetResults ()
 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.

Definition at line 37 of file MapGenerator.h.

Constructor & Destructor Documentation

CMapGenerator::CMapGenerator ( )

Definition at line 262 of file MapGenerator.cpp.

CMapGenerator::~CMapGenerator ( )

Definition at line 266 of file MapGenerator.cpp.

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

Definition at line 271 of file MapGenerator.cpp.

int CMapGenerator::GetProgress ( )

Get status of the map generator thread.

Returns
Progress percentage 1-100 if active, 0 when finished, or -1 on error

Definition at line 276 of file MapGenerator.cpp.

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

Definition at line 281 of file MapGenerator.cpp.

CMapGenerator::NONCOPYABLE ( CMapGenerator  )
private

Member Data Documentation

CMapGeneratorWorker* CMapGenerator::m_Worker
private

Definition at line 69 of file MapGenerator.h.


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