port/mars-tycoon
Last change
on this file since 88089e4 was 80a6a52, checked in by Jonathan Neufeld <support@…>, 3 years ago |
Get to a compile state for terrain procedural generation
|
-
Property mode
set to
100755
|
File size:
939 bytes
|
Line | |
---|
1 | #include "yamlsessreader.h"
|
---|
2 | #include "yamlext.h"
|
---|
3 |
|
---|
4 | namespace genesis
|
---|
5 | {
|
---|
6 | using namespace geoworld;
|
---|
7 |
|
---|
8 | YAMLSynthSessCfgReader::YAMLSynthSessCfgReader( std::istream & input )
|
---|
9 | : _input(input) {}
|
---|
10 | YAMLSynthSessCfgReader::~YAMLSynthSessCfgReader() {}
|
---|
11 |
|
---|
12 | bool YAMLSynthSessCfgReader::load( geoworld::SynthesisSessionConfig & cfg )
|
---|
13 | {
|
---|
14 | using namespace YAML;
|
---|
15 |
|
---|
16 | Node nd = Load(_input);
|
---|
17 | try
|
---|
18 | {
|
---|
19 | const YAML::Node
|
---|
20 | & ndPasses = nd["passes"],
|
---|
21 | & ndGeohost = nd["geohost"],
|
---|
22 | & ndMacro = nd["macro"];
|
---|
23 |
|
---|
24 | ndPasses["count"] >> cfg.passes.count;
|
---|
25 | ndPasses["morphs"] >> cfg.passes.morphcount;
|
---|
26 | ndGeohost["layers"] >> cfg.geohost.layercount;
|
---|
27 | ndGeohost["classes"] >> cfg.geohost.classcount;
|
---|
28 | ndMacro["morphs"] >> cfg.macro.morphcount;
|
---|
29 | ndMacro["lod"] >> cfg.macro.lod;
|
---|
30 | ndMacro["coarseness"] >> cfg.macro.coarseness;
|
---|
31 |
|
---|
32 | return true;
|
---|
33 | }
|
---|
34 | catch (YAML::RepresentationException &)
|
---|
35 | {
|
---|
36 | return false;
|
---|
37 | }
|
---|
38 | }
|
---|
39 |
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.