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

Method updateBattlescapeUIDrawOrder

game/state/tilemap/tile.cpp:256–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void Tile::updateBattlescapeUIDrawOrder()
257{
258 if (map.ceaseUpdates)
259 {
260 return;
261 }
262 bool backFound = false;
263 bool targetFound = false;
264
265 unsigned int object_count = (unsigned)drawnObjects[0].size();
266 unsigned int obj_id;
267 for (obj_id = 0; obj_id < object_count; obj_id++)
268 {
269 auto &obj = drawnObjects[0][obj_id];
270 if (!backFound && obj->getType() != TileObject::Type::Ground)
271 {
272 drawBattlescapeSelectionBackAt = obj_id;
273 backFound = true;
274 }
275 if (!targetFound && (int)obj->getType() > 3)
276 {
277 drawTargetLocationIconAt = obj_id;
278 targetFound = true;
279 }
280 }
281 if (!backFound)
282 {
283 drawBattlescapeSelectionBackAt = obj_id;
284 }
285 if (!targetFound)
286 {
287 drawTargetLocationIconAt = obj_id;
288 }
289}
290
291void Tile::updateBattlescapeUnitPresent()
292{

Callers 3

setPositionMethod · 0.80
removeFromMapMethod · 0.80

Calls 2

sizeMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected