]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Interpreter.cpp
made Interpreter constructor explicit and added an error message
[l2e.git] / src / loader / Interpreter.cpp
index 97ed93981e405fc1fa3a56e450ce0c51ee8ddf66..0b81323b03b39fc4800ae64cc38317e5e21ddc15 100644 (file)
@@ -69,6 +69,15 @@ Interpreter::~Interpreter() {
 }
 
 
+const Interpreter::ParsedDefinition &Interpreter::GetDefinition(const string &identifier) const {
+       try {
+               return parsedDefinitions.at(identifier);
+       } catch (...) {
+               throw std::runtime_error("cannot find definition for " + identifier);
+       }
+}
+
+
 void *Interpreter::GetObject(int typeId, const std::string &name) {
        map<string, ParsedDefinition>::const_iterator i(parsedDefinitions.find(name));
        if (i != parsedDefinitions.end()) {