Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/helpers/HierarchicalPathfinder.h
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | #ifdef TEST | ||||
{ | { | ||||
return (m_ChunkI == b.m_ChunkI && m_ChunkJ == b.m_ChunkJ && m_RegionsID.size() == b.m_RegionsID.size() && memcmp(&m_Regions, &b.m_Regions, sizeof(u16) * CHUNK_SIZE * CHUNK_SIZE) == 0); | return (m_ChunkI == b.m_ChunkI && m_ChunkJ == b.m_ChunkJ && m_RegionsID.size() == b.m_RegionsID.size() && memcmp(&m_Regions, &b.m_Regions, sizeof(u16) * CHUNK_SIZE * CHUNK_SIZE) == 0); | ||||
} | } | ||||
#endif | #endif | ||||
}; | }; | ||||
typedef std::map<RegionID, std::set<RegionID> > EdgesMap; | typedef std::map<RegionID, std::set<RegionID> > EdgesMap; | ||||
void FindEdges(u8 ci, u8 cj, pass_class_t passClass, EdgesMap& edges); | void ComputeNeighbors(EdgesMap& edges, Chunk& a, Chunk& b, bool transpose, bool opposite) const; | ||||
void RecomputeAllEdges(pass_class_t passClass, EdgesMap& edges); | |||||
void UpdateEdges(u8 ci, u8 cj, pass_class_t passClass, EdgesMap& edges); | |||||
void FindReachableRegions(RegionID from, std::set<RegionID>& reachable, pass_class_t passClass) const; | void FindReachableRegions(RegionID from, std::set<RegionID>& reachable, pass_class_t passClass) const; | ||||
void FindPassableRegions(std::set<RegionID>& regions, pass_class_t passClass) const; | void FindPassableRegions(std::set<RegionID>& regions, pass_class_t passClass) const; | ||||
/** | /** | ||||
* Updates @p iGoal and @p jGoal to the navcell that is the nearest to the | * Updates @p iGoal and @p jGoal to the navcell that is the nearest to the | ||||
* initial goal coordinates, in one of the given @p regions. | * initial goal coordinates, in one of the given @p regions. | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator