1 #include "ResourceIndex.hpp"
2 #include "WorldResources.hpp"
4 #include "../app/Assets.hpp"
9 ResourceIndex::ResourceIndex()
14 std::size_t ResourceIndex::GetID(const std::string &name) {
15 auto entry = id_map.find(name);
16 if (entry == id_map.end()) {
17 auto result = id_map.emplace(name, Size());
18 return result.first->second;
25 WorldResources::WorldResources()
34 void WorldResources::Load(const AssetLoader &loader, const std::string &set_name) {
35 loader.LoadShapes(set_name, shapes);
36 loader.LoadBlockTypes(set_name, block_types, snd_index, tex_index, shapes);
37 loader.LoadModels(set_name, models, tex_index, shapes);