18 #ifndef INCLUDED_MAPGENERATOR 19 #define INCLUDED_MAPGENERATOR 26 #include <boost/random/linear_congruential.hpp> 96 void Initialize(
const VfsPath& scriptFile,
const std::string& settings);
117 void InitScriptInterface(
const u32 seed);
124 void RegisterScriptFunctions_MapGenerator();
132 bool LoadScripts(
const VfsPath& libraryName);
137 void ExportMap(JS::HandleValue data);
152 void SetProgress(
int progress);
172 std::vector<std::string> FindTemplates(
const std::string& path,
bool includeSubdirectories);
177 std::vector<std::string> FindActorTemplates(
const std::string& path,
bool includeSubdirectories);
237 #endif //INCLUDED_MAPGENERATOR std::set< VfsPath > m_LoadedLibraries
Currently loaded script librarynames.
Definition: MapGenerator.h:187
An entity initialisation parameter node.
Definition: ParamNode.h:150
CTemplateLoader m_TemplateLoader
Backend to loading template data.
Definition: MapGenerator.h:222
int GetProgress()
Get status of the map generator thread.
Definition: MapGenerator.cpp:416
Template loader: Handles the loading of entity template files for:
Definition: TemplateLoader.h:47
int m_Progress
Current map generation progress.
Definition: MapGenerator.h:202
CMapGeneratorWorker * m_Worker
Definition: MapGenerator.h:71
std::shared_ptr< JSStructuredCloneData > StructuredClone
Structured clones are a way to serialize 'simple' JS::Values into a buffer that can safely be passed ...
Definition: StructuredClone.h:36
Script::StructuredClone m_MapData
Result of the mapscript generation including terrain, entities and environment settings.
Definition: MapGenerator.h:192
boost::rand48 m_MapGenRNG
Deterministic random number generator.
Definition: MapGenerator.h:197
std::mutex m_WorkerMutex
Avoids thread synchronization issues.
Definition: MapGenerator.h:233
Random map generator interface.
Definition: MapGenerator.h:39
Future< void > m_WorkerThread
Holds the completion result of the asynchronous map generation.
Definition: MapGenerator.h:228
CMapGenerator()
Definition: MapGenerator.cpp:402
Script::StructuredClone GetResults()
Get random map data, according to this format: http://trac.wildfiregames.com/wiki/Random_Map_Generato...
Definition: MapGenerator.cpp:421
uint32_t u32
Definition: types.h:39
Config::Value_type Value
Definition: json_spirit_value.h:182
ScriptInterface * m_ScriptInterface
Provides the script context.
Definition: MapGenerator.h:207
std::string m_Settings
Map and simulation settings chosen in the gamesetup stage.
Definition: MapGenerator.h:217
VfsPath m_ScriptPath
Map generation script to run.
Definition: MapGenerator.h:212
CParamNode GetTemplate(const std::string &templateName)
Definition: GameSetup.cpp:785
Random map generator worker thread.
Definition: MapGenerator.h:84
bool TemplateExists(const std::string &templateName)
Definition: JSInterface_GUIManager.cpp:66
void GenerateMap(const VfsPath &scriptFile, const std::string &settings)
Start the map generator thread.
Definition: MapGenerator.cpp:411
Abstraction around a SpiderMonkey JS::Realm.
Definition: ScriptInterface.h:71
~CMapGenerator()
Definition: MapGenerator.cpp:406
double GetMicroseconds()
Microseconds since the epoch.
Definition: JSInterface_Debug.cpp:36
NONCOPYABLE(CMapGenerator)
static Status Run(const Operation &op, const Parameters &p=Parameters(), const CompletedHook &completedHook=CompletedHook(), const IssueHook &issueHook=IssueHook())
Definition: io.h:243