diff --git a/components/esm_store/reclists.hpp b/components/esm_store/reclists.hpp index 196ce6063..75d4e67ae 100644 --- a/components/esm_store/reclists.hpp +++ b/components/esm_store/reclists.hpp @@ -131,6 +131,35 @@ namespace ESMS } } }; + + template + struct ScriptListT : RecList + { + typedef std::map MapType; + + MapType list; + + // Load one object of this type + void load(ESMReader &esm, const std::string &id) + { + X ref; + ref.load (esm); + + std::string realId = ref.data.name.toString(); + + std::swap (list[realId], ref); + } + + // Find the given object ID, or return NULL if not found. + const X* find(const std::string &id) const + { + if(list.find(id) == list.end()) + return NULL; + return &list.find(id)->second; + } + + int getSize() { return list.size(); } + }; /* We need special lists for: diff --git a/components/esm_store/store.hpp b/components/esm_store/store.hpp index 44bd87279..7c4971ac4 100644 --- a/components/esm_store/store.hpp +++ b/components/esm_store/store.hpp @@ -73,7 +73,7 @@ namespace ESMS //RecListT lands; //RecListT landTexts; //RecListT magicEffects; - //RecListT