2004-05-29 05:32:33 +02:00
|
|
|
// PathfindEngine.h
|
|
|
|
//
|
|
|
|
// The pathfinding engine singleton.
|
|
|
|
//
|
2007-05-02 14:07:08 +02:00
|
|
|
// Usage: g_Pathfinder.RequestPath( HEntity me, float x, float y );
|
2004-05-29 05:32:33 +02:00
|
|
|
//
|
|
|
|
// Mark Thompson mot20@cam.ac.uk / mark@wildfiregames.com
|
|
|
|
|
2007-05-07 18:33:24 +02:00
|
|
|
#ifndef INCLUDED_PATHFINDENGINE
|
|
|
|
#define INCLUDED_PATHFINDENGINE
|
2004-05-29 05:32:33 +02:00
|
|
|
|
2006-06-02 04:10:27 +02:00
|
|
|
#include "ps/Singleton.h"
|
2004-05-29 05:32:33 +02:00
|
|
|
#include "EntityHandles.h"
|
2006-06-02 05:56:24 +02:00
|
|
|
#include "ps/Vector2D.h"
|
2006-05-13 20:50:58 +02:00
|
|
|
#include "AStarEngine.h"
|
2004-05-29 05:32:33 +02:00
|
|
|
|
|
|
|
#define g_Pathfinder CPathfindEngine::GetSingleton()
|
|
|
|
|
2005-12-29 09:42:44 +01:00
|
|
|
class CEntityOrder;
|
|
|
|
|
2004-11-11 08:09:32 +01:00
|
|
|
enum EPathType
|
|
|
|
{
|
|
|
|
PF_STANDARD,
|
|
|
|
PF_ATTACK_MELEE,
|
|
|
|
};
|
|
|
|
|
2006-04-11 00:05:21 +02:00
|
|
|
|
2004-05-29 05:32:33 +02:00
|
|
|
class CPathfindEngine : public Singleton<CPathfindEngine>
|
|
|
|
{
|
|
|
|
public:
|
2004-07-23 12:56:52 +02:00
|
|
|
CPathfindEngine();
|
2006-09-09 02:00:23 +02:00
|
|
|
|
2007-05-02 14:07:08 +02:00
|
|
|
void RequestPath( HEntity entity, const CVector2D& destination,
|
2006-09-09 02:00:23 +02:00
|
|
|
CEntityOrder::EOrderSource orderSource );
|
|
|
|
|
2007-05-02 14:07:08 +02:00
|
|
|
void RequestLowLevelPath( HEntity entity, const CVector2D& destination, bool contact,
|
2006-09-09 02:00:23 +02:00
|
|
|
float radius, CEntityOrder::EOrderSource orderSource );
|
|
|
|
|
2007-05-02 14:07:08 +02:00
|
|
|
void RequestContactPath( HEntity entity, CEntityOrder* current, float range );
|
|
|
|
bool RequestAvoidPath( HEntity entity, CEntityOrder* current, float avoidRange );
|
2006-04-11 00:05:21 +02:00
|
|
|
private:
|
2006-05-13 20:50:58 +02:00
|
|
|
CAStarEngineLowLevel mLowPathfinder;
|
2004-05-29 05:32:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|