39 lines
715 B
C
39 lines
715 B
C
#pragma once
|
|
#include "lua.h"
|
|
|
|
#define MIN_DIR_ERR 5.0*M_PI/180.
|
|
#define MAX_DIR_ERR 0.5*M_PI/180.
|
|
#define MIN_VEL_ERR 5.0
|
|
|
|
#define FACE_WVEL 0.1 /* Weight of velocity compared to position to face. */
|
|
|
|
/* Max number of AI timers. */
|
|
#define MAX_AI_TIMERS 2
|
|
|
|
typedef enum TaskData_ { TYPE_NULL, TYPE_INT, TYPE_PTR } TaskData;
|
|
|
|
/* Basic task. */
|
|
typedef struct Task_ {
|
|
struct Task_* next;
|
|
char* name;
|
|
|
|
TaskData dtype;
|
|
union {
|
|
void* target; /* Vec2 etc. */
|
|
unsigned int ID; /* Pilot ID etc. */
|
|
} dat;
|
|
} Task;
|
|
|
|
/* Ai profile. */
|
|
typedef struct AI_Profile_ {
|
|
char* name;
|
|
lua_State* L;
|
|
} AI_Profile;
|
|
|
|
/* Misc. */
|
|
AI_Profile* ai_getProfile(char* name);
|
|
|
|
int ai_init(void);
|
|
void ai_exit(void);
|
|
|