| 97 | } |
| 98 | |
| 99 | Json EntityFactory::diskStoreEntity(EntityPtr const& entity) const { |
| 100 | RecursiveMutexLocker locker(m_mutex); |
| 101 | |
| 102 | if (auto player = as<Player>(entity)) { |
| 103 | return player->diskStore(); |
| 104 | } else if (auto monster = as<Monster>(entity)) { |
| 105 | return monster->diskStore(); |
| 106 | } else if (auto object = as<Object>(entity)) { |
| 107 | return object->diskStore(); |
| 108 | } else if (auto plant = as<Plant>(entity)) { |
| 109 | return plant->diskStore(); |
| 110 | } else if (auto itemDrop = as<ItemDrop>(entity)) { |
| 111 | return itemDrop->diskStore(); |
| 112 | } else if (auto npc = as<Npc>(entity)) { |
| 113 | return npc->diskStore(); |
| 114 | } else if (auto stagehand = as<Stagehand>(entity)) { |
| 115 | return stagehand->diskStore(); |
| 116 | } else if (auto vehicle = as<Vehicle>(entity)) { |
| 117 | return m_vehicleDatabase->diskStore(vehicle); |
| 118 | } else { |
| 119 | throw EntityFactoryException::format("Don't know how to make disk store for entity type '{}'", EntityTypeNames.getRight(entity->entityType())); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | EntityPtr EntityFactory::diskLoadEntity(EntityType type, Json const& diskStore) const { |
| 124 | RecursiveMutexLocker locker(m_mutex); |
nothing calls this directly
no test coverage detected