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
@@ -6,6 +6,7 @@
|
||||
#include "core/resources/resource_helper.hpp"
|
||||
#include "game/entities/entity.hpp"
|
||||
#include "game/entities/entity_factory.hpp"
|
||||
#include "game/map/room_yaml.hpp"
|
||||
#include "utils/defaults.hpp"
|
||||
|
||||
namespace EntityLoader {
|
||||
@@ -44,13 +45,7 @@ namespace EntityLoader {
|
||||
}
|
||||
|
||||
auto readSpawns(const std::string& level_yaml_path) -> std::vector<fkyaml::node> {
|
||||
auto bytes = Resource::Helper::loadFile(level_yaml_path);
|
||||
if (bytes.empty()) {
|
||||
throw std::runtime_error("EntityLoader: no s'ha pogut obrir " + level_yaml_path);
|
||||
}
|
||||
const auto* begin = reinterpret_cast<const char*>(bytes.data());
|
||||
const auto* end = begin + bytes.size();
|
||||
fkyaml::node root = fkyaml::node::deserialize(begin, end);
|
||||
fkyaml::node root = RoomYaml::loadMerged(level_yaml_path);
|
||||
std::vector<fkyaml::node> spawns;
|
||||
if (!root.contains("entities")) { return spawns; }
|
||||
const auto& list = root["entities"];
|
||||
|
||||
Reference in new issue
Block a user