MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetNeighborSectors

Function GetNeighborSectors

TombEngine/Game/collision/floordata.cpp:483–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481 }
482
483 std::vector<FloorInfo*> GetNeighborSectors(const Vector3i& pos, int roomNumber, unsigned int searchDepth)
484 {
485 auto sectors = std::vector<FloorInfo*>{};
486
487 // Run through neighbor rooms.
488 auto& room = g_Level.Rooms[roomNumber];
489 for (int neighborRoomNumber : room.NeighborRoomNumbers)
490 {
491 // Collect neighbor sectors.
492 auto roomGridCoords = GetNeighborRoomGridCoords(pos, neighborRoomNumber, searchDepth);
493 for (const auto& roomGridCoord : roomGridCoords)
494 sectors.push_back(&GetFloor(neighborRoomNumber, roomGridCoord));
495 }
496
497 // Return neighbor sectors.
498 return sectors;
499 }
500
501 FloorInfo& GetFloor(int roomNumber, const Vector2i& roomGridCoord)
502 {

Callers 2

AssignSectorsMethod · 0.85
DeassignSectorsMethod · 0.85

Calls 3

GetFloorFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected