diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-15 22:31:52 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-15 22:31:52 +0200 |
commit | 1795f3d47993e7a9833e6f265bb91fb6ce400f1c (patch) | |
tree | 766dd0f14ba4df90cbac836c03cdfc501c9cd009 /src/control/PathFind.h | |
parent | fix (diff) | |
parent | Merge pull request #440 from Fire-Head/master (diff) | |
download | re3-1795f3d47993e7a9833e6f265bb91fb6ce400f1c.tar re3-1795f3d47993e7a9833e6f265bb91fb6ce400f1c.tar.gz re3-1795f3d47993e7a9833e6f265bb91fb6ce400f1c.tar.bz2 re3-1795f3d47993e7a9833e6f265bb91fb6ce400f1c.tar.lz re3-1795f3d47993e7a9833e6f265bb91fb6ce400f1c.tar.xz re3-1795f3d47993e7a9833e6f265bb91fb6ce400f1c.tar.zst re3-1795f3d47993e7a9833e6f265bb91fb6ce400f1c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/control/PathFind.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/control/PathFind.h b/src/control/PathFind.h index 81467cdf..ea88ade6 100644 --- a/src/control/PathFind.h +++ b/src/control/PathFind.h @@ -3,11 +3,7 @@ #include "Treadable.h" class CVehicle; - -class CPedPath { -public: - static bool CalcPedRoute(uint8, CVector, CVector, CVector*, int16*, int16); -}; +class CPtrList; enum { @@ -30,6 +26,33 @@ enum SWITCH_ON = 1, }; +enum +{ + ROUTE_ADD_BLOCKADE = 0, + ROUTE_NO_BLOCKADE = 1 +}; + +struct CPedPathNode +{ + bool bBlockade; + uint8 nodeIdX; + uint8 nodeIdY; + int16 id; + CPedPathNode* prev; + CPedPathNode* next; +}; +static_assert(sizeof(CPedPathNode) == 0x10, "CPedPathNode: error"); + +class CPedPath { +public: + static bool CalcPedRoute(int8 pathType, CVector position, CVector destination, CVector *pointPoses, int16 *pointsFound, int16 maxPoints); + static void AddNodeToPathList(CPedPathNode *pNodeToAdd, int16 id, CPedPathNode *pNodeList); + static void RemoveNodeFromList(CPedPathNode *pNode); + static void AddNodeToList(CPedPathNode *pNode, int16 index, CPedPathNode *pList); + static void AddBlockade(CEntity *pEntity, CPedPathNode(*pathNodes)[40], CVector *pPosition); + static void AddBlockadeSectorList(CPtrList& list, CPedPathNode(*pathNodes)[40], CVector *pPosition); +}; + struct CPathNode { CVector pos; |