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

Method canBuildingBeRemoved

source/entities/Building.cpp:112–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112bool Building::canBuildingBeRemoved()
113{
114 // We check if a human player still have vision on one of the building tiles
115 bool ret = true;
116 for(std::pair<Tile* const, TileData*>& p : mTileData)
117 {
118 if(!p.second->mSeatsVision.empty())
119 {
120 ret = false;
121 break;
122 }
123 }
124
125 if(mBuildingObjects.empty())
126 return ret;
127
128 for (const std::pair<Tile* const, RenderedMovableEntity*>& p : mBuildingObjects)
129 {
130 RenderedMovableEntity* obj = p.second;
131 if(!obj->notifyRemoveAsked())
132 ret = false;
133 }
134
135 return ret;
136}
137
138void Building::removeAllBuildingObjects()
139{

Callers

nothing calls this directly

Calls 1

notifyRemoveAskedMethod · 0.45

Tested by

no test coverage detected