[Add] Documented Pilot.h

This commit is contained in:
Allanis 2013-09-09 01:31:14 +01:00
parent e1a43e2248
commit b44fb505cd

View File

@ -7,29 +7,29 @@
#include "sound.h" #include "sound.h"
#include "economy.h" #include "economy.h"
#define PLAYER_ID 1 #define PLAYER_ID 1 /**< Player pilot ID. */
#define HYPERSPACE_ENGINE_DELAY 3000 /* Warm up the engines. */ #define HYPERSPACE_ENGINE_DELAY 3000 /**< Warm up the engines. */
#define HYPERSPACE_FLY_DELAY 5000 /* Time taken to hyperspace. */ #define HYPERSPACE_FLY_DELAY 5000 /**< Time taken to hyperspace. */
#define HYPERSPACE_STARS_BLUR 2000 /* Time stars blur. */ #define HYPERSPACE_STARS_BLUR 2000 /**< Time stars blur. */
#define HYPERSPACE_STARS_LENGTH 1000 /* Length the stars blur to at max. */ #define HYPERSPACE_STARS_LENGTH 1000 /**< Length the stars blur to at max. */
#define HYPERSPACE_FADEOUT 1000 /* Time fadeout. */ #define HYPERSPACE_FADEOUT 1000 /**< Time fadeout. */
#define HYPERSPACE_FUEL 100 /* Amount of fuel taken. */ #define HYPERSPACE_FUEL 100 /**< Amount of fuel taken. */
/* Aproximation for pilot size. */ /* Aproximation for pilot size. */
#define PILOT_SIZE_APROX 0.8 #define PILOT_SIZE_APROX 0.8 /**< Approximation for pilot size. */
#define PILOT_DISABLED_ARMOUR 0.3 /* Based on armour percentage. */ #define PILOT_DISABLED_ARMOUR 0.3 /**< Armour % that makes it disabled. */
/* Hooks. */ /* Hooks. */
#define PILOT_HOOK_NONE 0 /* No hook. */ #define PILOT_HOOK_NONE 0 /**< No hook. */
#define PILOT_HOOK_DEATH 1 /* Pilot died. */ #define PILOT_HOOK_DEATH 1 /**< Pilot died. */
#define PILOT_HOOK_BOARD 2 /* Pilot got boarded. */ #define PILOT_HOOK_BOARD 2 /**< Pilot got boarded. */
#define PILOT_HOOK_DISABLE 3 /* Pilot got disabled. */ #define PILOT_HOOK_DISABLE 3 /**< Pilot got disabled. */
/* Flags. */ /* Flags. */
#define pilot_isFlag(p,f) (p->flags & (f)) #define pilot_isFlag(p,f) (p->flags & (f)) /**< Check if flag f is set on pilot p. */
#define pilot_setFlag(p,f) (p->flags |= (f)) #define pilot_setFlag(p,f) (p->flags |= (f)) /**< Set flag f on pilot p. */
#define pilot_rmFlag(p,f) (p->flags ^= (f)) #define pilot_rmFlag(p,f) (p->flags ^= (f)) /**< Remove flag f on pilot p. */
/* Creation. */ /* Creation. */
#define PILOT_PLAYER (1<<0) /**< Pilot is a player. */ #define PILOT_PLAYER (1<<0) /**< Pilot is a player. */
#define PILOT_HASTURRET (1<<20) /**< Pilot has turrets. */ #define PILOT_HASTURRET (1<<20) /**< Pilot has turrets. */
@ -50,20 +50,30 @@
#define PILOT_DELETE (1<<15) /**< Pilot will get delete asap. */ #define PILOT_DELETE (1<<15) /**< Pilot will get delete asap. */
/* Just makes life simpler. */ /* Just makes life simpler. */
#define pilot_isPlayer(p) ((p)->flags & PILOT_PLAYER) #define pilot_isPlayer(p) ((p)->flags & PILOT_PLAYER) /**< Check if pilot is a player. */
#define pilot_isDisabled(p) ((p)->flags & PILOT_DISABLED) #define pilot_isDisabled(p) ((p)->flags & PILOT_DISABLED) /**< Check if pilot is disabled. */
/**
* @struct PilotOutfit
*
* @brief Store an outfit the pilot has.
*/
typedef struct PilotOutfit_ { typedef struct PilotOutfit_ {
Outfit* outfit; /* Associated outfit. */ Outfit* outfit; /**< Associated outfit. */
int quantity; /* Number of outfits of this type that the pilot has. */ int quantity; /**< Number of outfits of this type that the pilot has. */
unsigned int timer; /* Used to store last used weapon time. */
unsigned int timer; /**< Used to store last used weapon time. */
} PilotOutfit; } PilotOutfit;
/* Pilot commodity. */ /**
* @struct PilotCommodity
*
* @brief Store a pilot commodity.
*/
typedef struct PilotCommodity_ { typedef struct PilotCommodity_ {
Commodity* commodity; Commodity* commodity; /**< Assotiated commodity. */
int quantity; int quantity; /**< Amount player has. */
unsigned int id; /* Special mission id for cargo. */ unsigned int id; /**< Special mission id for cargo, 0 means none. */
} PilotCommodity; } PilotCommodity;
/** /**
@ -74,7 +84,7 @@ typedef struct PilotCommodity_ {
typedef struct Pilot_ { typedef struct Pilot_ {
unsigned int id; /**< Pilots id. */ unsigned int id; /**< Pilots id. */
char* name; /**< Pilot's name (if unique). */ char* name; /**< Pilot's name (if unique). */
char* title; /**< Title - Usuall indicating special properties - TODO. */ char* title; /**< Title - Usuall indicating special properties - @todo. */
int faction; /**< Pilot faction. */ int faction; /**< Pilot faction. */
@ -142,22 +152,39 @@ typedef struct Pilot_ {
Task* task; /**< Current action. */ Task* task; /**< Current action. */
} Pilot; } Pilot;
/* Fleets. */ /**
* @struct FleetPilot
*
* @brief Represents a pilot in a fleet.
*
* @sa Fleet
* @sa Pilot
*/
typedef struct FleetPilot_ { typedef struct FleetPilot_ {
Ship* ship; /* Ship that the pilot is flying. */ Ship* ship; /**< Ship that the pilot is flying. */
char* name; /* For special 'unique' names. */ char* name; /**< For special 'unique' names. */
int chance; /* Chance of this pilot appearing in the fleet. */ int chance; /**< Chance of this pilot appearing in the fleet. */
AI_Profile* ai; /* AI different of fleets global ai. */ AI_Profile* ai; /**< AI different of fleets global ai. */
} FleetPilot; } FleetPilot;
/**
* @struct Fleet
*
* @brief Represents a fleet.
*
* Fleets are used to create pilots, both from being in a system and from
* mission triggers.
*
* @sa FleetPilot
*/
typedef struct Fleet_ { typedef struct Fleet_ {
char* name; /* Fleet name, used as an identifier. */ char* name; /**< Fleet name, used as an identifier. */
int faction; /* Faction of the fleet. */ int faction; /**< Faction of the fleet. */
AI_Profile* ai; /* A useable profile. */ AI_Profile* ai; /**< AI profile to use. */
FleetPilot* pilots; /* The pilots in the fleet. */ FleetPilot* pilots; /**< The pilots in the fleet. */
int npilots; /* Total number of pilots. */ int npilots; /**< Total number of pilots. */
} Fleet; } Fleet;
/* Grabing pilot crap. */ /* Grabing pilot crap. */