refactor(maps): pyramid.yaml per piràmide amb merge a sala
This commit is contained in:
1 parent
5f206e03c8
commit
125cdd0c74
45 files changed
+331
-1085
No files matched your search
@@ -38,6 +38,7 @@
|
||||
#include "game/gameplay_config.hpp"
|
||||
#include "game/levels/level_manager.hpp"
|
||||
#include "game/map/map.hpp"
|
||||
#include "game/map/room_yaml.hpp"
|
||||
#include "game/options.hpp"
|
||||
#include "game/scenes/scene_flow.hpp"
|
||||
#include "game/scenes/start_input.hpp"
|
||||
@@ -65,21 +66,13 @@ namespace {
|
||||
// pinta amb l'índex declarat al mapa, i un mapa sense aquests camps
|
||||
// simplement no deixa rastre visual.
|
||||
auto readOptionalInt(const std::string& yaml_path, const std::string& key, int fallback = -1) -> int {
|
||||
auto bytes = Resource::Helper::loadFile(yaml_path);
|
||||
if (bytes.empty()) { return fallback; }
|
||||
const auto* begin = reinterpret_cast<const char*>(bytes.data());
|
||||
const auto* end = begin + bytes.size();
|
||||
auto yaml = fkyaml::node::deserialize(begin, end);
|
||||
auto yaml = RoomYaml::loadMerged(yaml_path);
|
||||
if (!yaml.contains(key)) { return fallback; }
|
||||
return yaml[key].get_value<int>();
|
||||
}
|
||||
|
||||
auto readOptionalFloat(const std::string& yaml_path, const std::string& key, float fallback) -> float {
|
||||
auto bytes = Resource::Helper::loadFile(yaml_path);
|
||||
if (bytes.empty()) { return fallback; }
|
||||
const auto* begin = reinterpret_cast<const char*>(bytes.data());
|
||||
const auto* end = begin + bytes.size();
|
||||
auto yaml = fkyaml::node::deserialize(begin, end);
|
||||
auto yaml = RoomYaml::loadMerged(yaml_path);
|
||||
if (!yaml.contains(key)) { return fallback; }
|
||||
return yaml[key].get_value<float>();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user