From e1a43e2248bde25b20fef54f0ceb904d27c2b26b Mon Sep 17 00:00:00 2001 From: Allanis Date: Sat, 7 Sep 2013 19:07:01 +0100 Subject: [PATCH] [Add] Documented ai.h. --- src/ai.h | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/ai.h b/src/ai.h index eda2980..fcfc6e8 100644 --- a/src/ai.h +++ b/src/ai.h @@ -1,33 +1,41 @@ #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 MIN_DIR_ERR 5.0*M_PI/180. /**< Minimum direction error. */ +#define MAX_DIR_ERR 0.5*M_PI/180. /**< Maximum direction error. */ +#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. */ -#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; -/* Basic task. */ +/** + * @struct Task + * + * @brief Basic AI task. + */ typedef struct Task_ { - struct Task_* next; - char* name; + struct Task_* next; /**< Next task. */ + char* name; /**< Task name. */ - TaskData dtype; + TaskData dtype; /**< Data type. */ union { - void* target; /* Vec2 etc. */ - unsigned int ID; /* Pilot ID etc. */ - } dat; + void* target; /**< Vec2 etc. */ + unsigned int ID; /**< Pilot ID etc. */ + } dat; /**< Stores the data. */ } Task; -/* Ai profile. */ +/** + * @stuct Ai_Profile + * + * @brief Basic AI profile. + */ typedef struct AI_Profile_ { - char* name; - lua_State* L; + char* name; /**< Name of the profile. */ + lua_State* L; /**< Associated lua State. */ } AI_Profile; /* Misc. */