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

Function doesCellIntersectSomething

game/state/rules/battle/battlemap.cpp:401–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401bool doesCellIntersectSomething(std::vector<sp<BattleMapSector>> &sec_map,
402 const Vec3<int> &map_size, int x1, int y1, int z1)
403{
404 bool intersects = false;
405 static Vec3<int> cell_size = {1, 1, 1};
406 for (int x2 = 0; x2 < map_size.x; x2++)
407 for (int y2 = 0; y2 < map_size.y; y2++)
408 for (int z2 = 0; z2 < map_size.z; z2++)
409 intersects =
410 intersects ||
411 (sec_map[x2 + y2 * map_size.x + z2 * map_size.x * map_size.y] &&
412 doTwoSectorsIntersect(
413 x1, y1, z1, cell_size, x2, y2, z2,
414 sec_map[x2 + y2 * map_size.x + z2 * map_size.x * map_size.y]->size));
415 return intersects;
416}
417
418bool isMapComplete(std::vector<sp<BattleMapSector>> &sec_map, const Vec3<int> &map_size)
419{

Callers 2

isMapCompleteFunction · 0.85
placeSectorFunction · 0.85

Calls 1

doTwoSectorsIntersectFunction · 0.85

Tested by

no test coverage detected