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

Constructor & Destructor Documentation

◆ CMapGenerator()

CMapGenerator::CMapGenerator ( )

◆ ~CMapGenerator()

CMapGenerator::~CMapGenerator ( )

Member Function Documentation

◆ GenerateMap()

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

◆ GetProgress()

int CMapGenerator::GetProgress ( )

Get status of the map generator thread.

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

◆ GetResults()

Script::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

◆ NONCOPYABLE()

CMapGenerator::NONCOPYABLE ( CMapGenerator  )
private

Member Data Documentation

◆ m_Worker

CMapGeneratorWorker* CMapGenerator::m_Worker
private

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