![]() |
Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include "lib/file/vfs/vfs_path.h"#include "scriptinterface/ScriptTypes.h"#include "scriptinterface/StructuredClone.h"#include <atomic>#include <string>

Go to the source code of this file.
Functions | |
| Script::StructuredClone | RunMapGenerationScript (std::atomic< int > &progress, ScriptInterface &scriptInterface, const VfsPath &script, const std::string &settings, const u16 flags=JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT) |
| Generate the map. More... | |
| Script::StructuredClone RunMapGenerationScript | ( | std::atomic< int > & | progress, |
| ScriptInterface & | scriptInterface, | ||
| const VfsPath & | script, | ||
| const std::string & | settings, | ||
| const u16 | flags = JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT |
||
| ) |
Generate the map.
This does take a long time.
| progress | Destination to write the function progress to. You must not write to it while RunMapGenerationScript is running. |
| script | The VFS path for the script, e.g. "maps/random/latium.js". |
| settings | JSON string containing settings for the map generator. |
| flags | With thous flags the engine functions get registered g_MapSettings also respects this flags. |
nullptr is returned. Otherwise random map data, according to this format: https://trac.wildfiregames.com/wiki/Random_Map_Generator_Internals#Dataformat