Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/tests/test_HierPathfinder.h
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | public: | ||||
void assert_blank(HierarchicalPathfinder& hierPath) | void assert_blank(HierarchicalPathfinder& hierPath) | ||||
{ | { | ||||
u16 i = 89; | u16 i = 89; | ||||
u16 j = 34; | u16 j = 34; | ||||
hierPath.FindNearestPassableNavcell(i, j, PASS_1); | hierPath.FindNearestPassableNavcell(i, j, PASS_1); | ||||
TS_ASSERT(i == 89 && j == 34); | TS_ASSERT(i == 89 && j == 34); | ||||
for (auto& chunk : hierPath.m_Chunks[PASS_1]) | for (auto& chunk : hierPath.m_Chunks[PASS_1]) | ||||
TS_ASSERT(chunk.m_NumRegions == 1); | TS_ASSERT(chunk.m_RegionsID.size() == 1); | ||||
// number of connected regions: 4 in the middle, 2 in the corners. | // number of connected regions: 4 in the middle, 2 in the corners. | ||||
TS_ASSERT(hierPath.m_Edges[PASS_1][hierPath.Get(120, 120, PASS_1)].size() == 4); | TS_ASSERT(hierPath.m_Edges[PASS_1][hierPath.Get(120, 120, PASS_1)].size() == 4); | ||||
TS_ASSERT(hierPath.m_Edges[PASS_1][hierPath.Get(20, 20, PASS_1)].size() == 2); | TS_ASSERT(hierPath.m_Edges[PASS_1][hierPath.Get(20, 20, PASS_1)].size() == 2); | ||||
TS_ASSERT(hierPath.m_Edges[PASS_1][hierPath.Get(220, 220, PASS_1)].size() == 2); | TS_ASSERT(hierPath.m_Edges[PASS_1][hierPath.Get(220, 220, PASS_1)].size() == 2); | ||||
std::set<HierarchicalPathfinder::RegionID> reachables; | std::set<HierarchicalPathfinder::RegionID> reachables; | ||||
hierPath.FindReachableRegions(hierPath.Get(120, 120, PASS_1), reachables, PASS_1); | hierPath.FindReachableRegions(hierPath.Get(120, 120, PASS_1), reachables, PASS_1); | ||||
▲ Show 20 Lines • Show All 350 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator