Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpPathfinder.cpp
Show First 20 Lines • Show All 693 Lines • ▼ Show 20 Lines | void CCmpPathfinder::FindNearestPassableNavcell(u16& i, u16& j, pass_class_t passClass) | ||||
m_LongPathfinder.FindNearestPassableNavcell(i, j, passClass); | m_LongPathfinder.FindNearestPassableNavcell(i, j, passClass); | ||||
} | } | ||||
bool CCmpPathfinder::NavcellIsReachable(u16 i0, u16 j0, u16 i1, u16 j1, pass_class_t passClass) | bool CCmpPathfinder::NavcellIsReachable(u16 i0, u16 j0, u16 i1, u16 j1, pass_class_t passClass) | ||||
{ | { | ||||
return m_LongPathfinder.NavcellIsReachable(i0, j0, i1, j1, passClass); | return m_LongPathfinder.NavcellIsReachable(i0, j0, i1, j1, passClass); | ||||
} | } | ||||
bool CCmpPathfinder::OnSameNavcell(entity_pos_t xa, entity_pos_t za, entity_pos_t xb, entity_pos_t zb) const | |||||
{ | |||||
u16 ia, ja, ib, jb; | |||||
Pathfinding::NearestNavcell(xa, za, ia, ja, m_MapSize*Pathfinding::NAVCELLS_PER_TILE, m_MapSize*Pathfinding::NAVCELLS_PER_TILE); | |||||
Pathfinding::NearestNavcell(xb, zb, ib, jb, m_MapSize*Pathfinding::NAVCELLS_PER_TILE, m_MapSize*Pathfinding::NAVCELLS_PER_TILE); | |||||
return ia == ib && ja == jb; | |||||
} | |||||
////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////// | ||||
// Async path requests: | // Async path requests: | ||||
u32 CCmpPathfinder::ComputePathAsync(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, entity_id_t notify) | u32 CCmpPathfinder::ComputePathAsync(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, entity_id_t notify) | ||||
{ | { | ||||
AsyncLongPathRequest req = { m_NextAsyncTicket++, x0, z0, goal, passClass, notify }; | AsyncLongPathRequest req = { m_NextAsyncTicket++, x0, z0, goal, passClass, notify }; | ||||
m_AsyncLongPathRequests.push_back(req); | m_AsyncLongPathRequests.push_back(req); | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator