| 337 | } |
| 338 | |
| 339 | PersistentDataItem Persistence::addItem(int entity_id, const std::string &key) { |
| 340 | if (!is_good_entity_id(entity_id) || key.empty() || !Core::getInstance().isWorldLoaded()) |
| 341 | return PersistentDataItem(); |
| 342 | |
| 343 | CoreSuspender suspend; |
| 344 | |
| 345 | auto ptr = std::shared_ptr<DataEntry>(new DataEntry(entity_id, key)); |
| 346 | add_entry(entity_id, ptr); |
| 347 | return PersistentDataItem(ptr); |
| 348 | } |
| 349 | |
| 350 | PersistentDataItem Persistence::getByKey(int entity_id, const std::string &key, bool *added) { |
| 351 | if (!is_good_entity_id(entity_id) || key.empty() || !Core::getInstance().isWorldLoaded()) |
nothing calls this directly
no test coverage detected