33 lines
795 B
C
33 lines
795 B
C
#pragma once
|
|
#include "def.h"
|
|
#include "physics.h"
|
|
#include "ship.h"
|
|
|
|
#define PILOT_PLAYER 1 // Pilot is a player.
|
|
|
|
struct Pilot {
|
|
int id; // Pilot's id.
|
|
char* name; // Pilot's name (if unique).
|
|
|
|
Ship* ship; // Pilots ship.
|
|
Solid* solid; // Associated solid (physics).
|
|
|
|
// Current health.
|
|
FP armor, shield, energy;
|
|
|
|
void (*update)(struct Pilot*, const FP); // Update the pilot.
|
|
void (*think)(struct Pilot*); // AI thinking for the pilot.
|
|
|
|
unsigned int flags; // Used for AI etc.
|
|
};
|
|
typedef struct Pilot Pilot;
|
|
|
|
void pilot_init(Pilot* dest, Ship* ship, char* name,
|
|
const Vec2* vel, const Vec2* pos, const int flags);
|
|
|
|
Pilot* pilot_create(Ship* ship, char* name, const Vec2* vel,
|
|
const Vec2* pos, const int flags);
|
|
|
|
void pilot_free(Pilot* src);
|
|
|