| 204 | } |
| 205 | |
| 206 | void 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 | |
| 231 | void Room::updateActiveSpots() |
| 232 | { |
no test coverage detected