| 52 | } |
| 53 | |
| 54 | std::string requireStringField(const sol::table& table, const char* key, const char* context) { |
| 55 | const sol::object object = table[key]; |
| 56 | if (!object.is<std::string>()) { |
| 57 | throw std::runtime_error(std::string(context) + " requires string field '" + key + "'"); |
| 58 | } |
| 59 | return object.as<std::string>(); |
| 60 | } |
| 61 | |
| 62 | bool ScriptBatch::spawn(const std::string& speciesName, const sol::object& positionObject, const sol::object& optionsObject) { |
| 63 | const glm::vec3 position = readVec3Object(positionObject); |