MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / updateCityscapeParameters

Method updateCityscapeParameters

game/state/tilemap/tile.cpp:321–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321void Tile::updateCityscapeParameters()
322{
323 if (map.ceaseUpdates)
324 {
325 return;
326 }
327 height = 0.0f;
328 overlayHeight = 0.0f;
329 presentScenery = nullptr;
330 for (auto &o : ownedObjects)
331 {
332 if (o->getType() == TileObject::Type::Scenery)
333 {
334 auto mp = std::static_pointer_cast<TileObjectScenery>(o)->getOwner();
335 if (!mp->isAlive())
336 {
337 continue;
338 }
339 presentScenery = mp;
340 height = (float)mp->type->height / 16.1f;
341 overlayHeight = (float)mp->type->overlayHeight / 16.1f;
342 break;
343 }
344 }
345}
346
347void Tile::updateBattlescapeParameters()
348{

Callers 3

setPositionMethod · 0.80
removeFromMapMethod · 0.80
updateAllCityInfoMethod · 0.80

Calls 3

getTypeMethod · 0.45
getOwnerMethod · 0.45
isAliveMethod · 0.45

Tested by

no test coverage detected