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

Method checkForRoomAbsorbtion

source/rooms/Room.cpp:206–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void Room::checkForRoomAbsorbtion()
207{
208 bool isRoomAbsorbed = false;
209 for (Tile* tile : getGameMap()->tilesBorderedByRegion(getCoveredTiles()))
210 {
211 Room* room = tile->getCoveringRoom();
212 if(room == nullptr)
213 continue;
214 if(room == this)
215 continue;
216 if(room->getSeat() != getSeat())
217 continue;
218 if(room->getType() != getType())
219 continue;
220
221 absorbRoom(room);
222 // All the tiles from the absorbed room have been transferred to this one
223 // No need to delete it since it will be removed during its next upkeep
224 isRoomAbsorbed = true;
225 }
226
227 if(isRoomAbsorbed)
228 reorderRoomTiles(mCoveredTiles);
229}
230
231void Room::updateActiveSpots()
232{

Callers 2

buildRoomDefaultMethod · 0.80
buildRoomMethod · 0.80

Calls 4

tilesBorderedByRegionMethod · 0.80
getCoveringRoomMethod · 0.80
getSeatMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected