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

Method exportToStream

source/rooms/RoomPrison.cpp:256–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void RoomPrison::exportToStream(std::ostream& os) const
257{
258 Room::exportToStream(os);
259
260 std::vector<Creature*> creatures;
261 for(Tile* tile : mCoveredTiles)
262 {
263 for(GameEntity* entity : tile->getEntitiesInTile())
264 {
265 if(entity->getObjectType() != GameEntityType::creature)
266 continue;
267
268 Creature* creature = static_cast<Creature*>(entity);
269 if(creature->getSeatPrison() != getSeat())
270 continue;
271
272 creatures.push_back(creature);
273 }
274 }
275
276 uint32_t nb = creatures.size();
277 os << nb;
278 for(Creature* creature : creatures)
279 {
280 os << "\t" << creature->getName();
281 }
282 os << "\n";
283}
284
285bool RoomPrison::importFromStream(std::istream& is)
286{

Callers

nothing calls this directly

Calls 2

getSeatPrisonMethod · 0.80
getObjectTypeMethod · 0.45

Tested by

no test coverage detected