Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 83 lines (59 sloc) 1.442 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
/*
* See Licensing and Copyright notice in naev.h
*/



#ifndef AI_H
# define AI_H


/* yay Lua */
#include <lua.h>

#include "physics.h"

#define AI_MEM "__mem" /**< Internal pilot memory. */


#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. */


/* maximum number of AI timers */
#define MAX_AI_TIMERS 2 /**< Max amount of AI timers. */


/**
* @enum TaskData
*
* @brief Task data types.
*/
typedef enum TaskData_ {
   TASKDATA_NULL,
   TASKDATA_INT,
   TASKDATA_VEC2
} TaskData;

/**
* @struct Task
*
* @brief Basic AI task.
*/
typedef struct Task_ {
   struct Task_* next; /**< Next task */
   char *name; /**< Task name. */
   int done; /**< Task is done and ready for deletion. */

   struct Task_* subtask; /**< Subtasks of the current task. */

   TaskData dtype; /**< Data type. */
   union {
      unsigned int num; /**< Pilot ID, etc... */
      Vector2d vec; /**< Vector. */
   } dat; /**< Stores the data. */
} Task;


/**
* @struct AI_Profile
*
* @brief Basic AI profile.
*/
typedef struct AI_Profile_ {
   char* name; /**< Name of the profile. */
   lua_State *L; /**< Assosciated Lua State. */
} AI_Profile;


/*
* misc
*/
AI_Profile* ai_getProfile( char* name );


/*
* init/exit
*/
int ai_load (void);
void ai_exit (void);


#endif /* AI_H */
Something went wrong with that request. Please try again.