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

Method exportTileDataToStream

source/rooms/Room.cpp:498–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496}
497
498void Room::exportTileDataToStream(std::ostream& os, Tile* tile, TileData* tileData) const
499{
500 if(getGameMap()->isInEditorMode())
501 return;
502
503 os << "\t" << tileData->mHP;
504
505 // We only save enemy seats that have vision on the building
506 std::vector<Seat*> seatsToSave;
507 for(Seat* seat : tileData->mSeatsVision)
508 {
509 if(getSeat()->isAlliedSeat(seat))
510 continue;
511
512 seatsToSave.push_back(seat);
513 }
514 uint32_t nbSeatsVision = seatsToSave.size();
515 os << "\t" << nbSeatsVision;
516 for(Seat* seat : seatsToSave)
517 os << "\t" << seat->getId();
518}
519
520bool Room::importTileDataFromStream(std::istream& is, Tile* tile, TileData* tileData)
521{

Callers

nothing calls this directly

Calls 3

isInEditorModeMethod · 0.80
isAlliedSeatMethod · 0.80
getIdMethod · 0.45

Tested by

no test coverage detected