[Add] Documented ai.h.

This commit is contained in:
Allanis 2013-09-07 19:07:01 +01:00
parent d1df9aeaae
commit e1a43e2248

View File

@ -1,33 +1,41 @@
#pragma once #pragma once
#include "lua.h" #include "lua.h"
#define MIN_DIR_ERR 5.0*M_PI/180. #define MIN_DIR_ERR 5.0*M_PI/180. /**< Minimum direction error. */
#define MAX_DIR_ERR 0.5*M_PI/180. #define MAX_DIR_ERR 0.5*M_PI/180. /**< Maximum direction error. */
#define MIN_VEL_ERR 5.0 #define MIN_VEL_ERR 5.0 /**< Minimum velocity error. */
#define FACE_WVEL 0.1 /* Weight of velocity compared to position to face. */ #define FACE_WVEL 0.1 /**< Weight of velocity compared to position to face. */
/* Max number of AI timers. */ /* Max number of AI timers. */
#define MAX_AI_TIMERS 2 #define MAX_AI_TIMERS 2 /**< Max amount of AI timers. */
typedef enum TaskData_ { TYPE_NULL, TYPE_INT, TYPE_PTR } TaskData; typedef enum TaskData_ { TYPE_NULL, TYPE_INT, TYPE_PTR } TaskData;
/* Basic task. */ /**
* @struct Task
*
* @brief Basic AI task.
*/
typedef struct Task_ { typedef struct Task_ {
struct Task_* next; struct Task_* next; /**< Next task. */
char* name; char* name; /**< Task name. */
TaskData dtype; TaskData dtype; /**< Data type. */
union { union {
void* target; /* Vec2 etc. */ void* target; /**< Vec2 etc. */
unsigned int ID; /* Pilot ID etc. */ unsigned int ID; /**< Pilot ID etc. */
} dat; } dat; /**< Stores the data. */
} Task; } Task;
/* Ai profile. */ /**
* @stuct Ai_Profile
*
* @brief Basic AI profile.
*/
typedef struct AI_Profile_ { typedef struct AI_Profile_ {
char* name; char* name; /**< Name of the profile. */
lua_State* L; lua_State* L; /**< Associated lua State. */
} AI_Profile; } AI_Profile;
/* Misc. */ /* Misc. */