MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / getRoomFromStream

Method getRoomFromStream

source/rooms/RoomManager.cpp:411–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411Room* RoomManager::getRoomFromStream(GameMap* gameMap, std::istream& is)
412{
413 RoomType type;
414 if(!(is >> type))
415 return nullptr;
416
417 std::vector<const RoomFactory*>& factories = getFactories();
418 uint32_t index = static_cast<uint32_t>(type);
419 if(index >= factories.size())
420 {
421 OD_LOG_ERR("type=" + Helper::toString(index) + ", factories.size=" + Helper::toString(factories.size()));
422 return nullptr;
423 }
424
425 const RoomFactory& factory = *factories[index];
426 return factory.getRoomFromStream(gameMap, is);
427}
428
429bool RoomManager::buildRoomOnTiles(GameMap* gameMap, RoomType type, Player* player, const std::vector<Tile*>& tiles)
430{

Callers 1

loadMethod · 0.45

Calls 1

toStringFunction · 0.50

Tested by

no test coverage detected