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

Method exportToStream

source/rooms/RoomTorture.cpp:416–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414 creature.pushAction(Utils::make_unique<CreatureActionUseRoom>(creature, *this, true));
415}
416void RoomTorture::exportToStream(std::ostream& os) const
417{
418 Room::exportToStream(os);
419
420 std::vector<Creature*> creatures;
421 for(Tile* tile : mCoveredTiles)
422 {
423 for(GameEntity* entity : tile->getEntitiesInTile())
424 {
425 if(entity->getObjectType() != GameEntityType::creature)
426 continue;
427
428 Creature* creature = static_cast<Creature*>(entity);
429 if(creature->getSeatPrison() != getSeat())
430 continue;
431
432 creatures.push_back(creature);
433 }
434 }
435
436 uint32_t nb = creatures.size();
437 os << nb;
438 for(Creature* creature : creatures)
439 {
440 os << "\t" << creature->getName();
441 }
442 os << "\n";
443}
444
445bool RoomTorture::importFromStream(std::istream& is)
446{

Callers

nothing calls this directly

Calls 2

getSeatPrisonMethod · 0.80
getObjectTypeMethod · 0.45

Tested by

no test coverage detected