| 177 | } |
| 178 | |
| 179 | sol::object Registry::valueOfType(std::string_view key, Type type) |
| 180 | { |
| 181 | Id id = safeIdByKey(key); |
| 182 | Info info = mInfo[id]; |
| 183 | if (info.mType != type) |
| 184 | { |
| 185 | std::string message("Attempt to get value of type \""); |
| 186 | message += typeName(type); |
| 187 | message += "\" from action \""; |
| 188 | message += key; |
| 189 | message += "\" with type \""; |
| 190 | message += typeName(info.mType); |
| 191 | message += "\""; |
| 192 | throw std::logic_error(message); |
| 193 | } |
| 194 | return mValues[id]; |
| 195 | } |
| 196 | |
| 197 | void Registry::update(double dt) |
| 198 | { |