2004-05-22 02:57:54 +02:00
|
|
|
// EntityOrders.h
|
|
|
|
//
|
|
|
|
// Last modified: 22 May 04, Mark Thompson mot20@cam.ac.uk / mark@wildfiregames.com
|
|
|
|
//
|
|
|
|
// Entity orders structure.
|
|
|
|
//
|
|
|
|
// Usage: All orders at this point use the location component of the union.
|
|
|
|
// Orders are: ORDER_GOTO_NOPATHING: Attempts to reach the given destination via a line-of-sight
|
2004-06-03 04:20:48 +02:00
|
|
|
// ORDER_GOTO_SMOOTED: system. Do not create an order of these types directly; it is
|
2004-05-22 02:57:54 +02:00
|
|
|
// used to return a path of line segments from the pathfinder.
|
2004-06-03 04:20:48 +02:00
|
|
|
// _SMOOTHED flags to the entity state-control that it's OK to
|
|
|
|
// smooth the corner between segments. _NOPATHING just does
|
|
|
|
// zero-radius turns.
|
2004-05-26 22:57:25 +02:00
|
|
|
// ORDER_GOTO_COLLISION: When the coldet system is trying to get us out of a collision,
|
|
|
|
// it generates these intermediate waypoints. We don't really have
|
|
|
|
// any reason to go to this specific point, so if a better way
|
|
|
|
// comes along, this order can be deleted.
|
2004-05-22 02:57:54 +02:00
|
|
|
// ORDER_GOTO: Attempts to reach the given destination. Uses the pathfinder
|
|
|
|
// to... er... find the path.
|
|
|
|
// Create this order when a standard movement or movement waypoint
|
|
|
|
// order is required.
|
|
|
|
// ORDER_PATROL: As ORDER_GOTO, but pushes the patrol order onto the back of the
|
|
|
|
// order queue after it's executed. In this way, the entity will
|
|
|
|
// circle round a list of patrol points.
|
|
|
|
// Create this order when a standard patrol order is required.
|
|
|
|
//
|
|
|
|
// Entities which exhaust all orders from their queue go to idle status; there is no specific order
|
|
|
|
// type for this status.
|
2004-05-22 01:46:16 +02:00
|
|
|
|
|
|
|
#ifndef ENTITY_ORDER_INCLUDED
|
|
|
|
#define ENTITY_ORDER_INCLUDED
|
|
|
|
|
|
|
|
#define ORDER_MAX_DATA 1
|
|
|
|
|
|
|
|
#include "EntityHandles.h"
|
2004-05-26 22:57:25 +02:00
|
|
|
#include "Vector2D.h"
|
2004-05-22 01:46:16 +02:00
|
|
|
|
|
|
|
struct SOrderData
|
|
|
|
{
|
2004-05-26 22:57:25 +02:00
|
|
|
CVector2D location;
|
|
|
|
u64 data; // miscellaneous
|
2004-05-22 01:46:16 +02:00
|
|
|
HEntity entity;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CEntityOrder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ORDER_GOTO_NOPATHING,
|
2004-06-03 04:20:48 +02:00
|
|
|
ORDER_GOTO_SMOOTHED,
|
2004-05-26 22:57:25 +02:00
|
|
|
ORDER_GOTO_COLLISION,
|
2004-05-22 01:46:16 +02:00
|
|
|
ORDER_GOTO,
|
|
|
|
ORDER_PATROL
|
|
|
|
} m_type;
|
|
|
|
SOrderData m_data[ORDER_MAX_DATA];
|
|
|
|
};
|
|
|
|
|
2004-06-02 18:11:32 +02:00
|
|
|
#endif
|