MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / saveWorld

Method saveWorld

src/engine/BaseEngine.cpp:183–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183bool BaseEngine::saveWorld(Handle::WorldHandle world, const std::string& file)
184{
185 json j;
186 world.get().exportWorld(j);
187
188 // Save
189 std::ofstream f(file);
190 if (!f.is_open())
191 return false;
192
193 f << Utils::iso_8859_1_to_utf8(j.dump(4));
194 f.close();
195
196 return true;
197}
198
199void BaseEngine::setPaused(bool paused)
200{

Callers

nothing calls this directly

Calls 5

iso_8859_1_to_utf8Function · 0.85
exportWorldMethod · 0.80
getMethod · 0.80
dumpMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected