#pragma once #include "main.h" #include "outfit.h" #include "opengl.h" // Target gfx dimensions. #define SHIP_TARGET_W 128 #define SHIP_TARGET_H 96 enum ship_class { SHIP_CLASS_NULL, SHIP_CLASS_CIV_LIGHT, SHIP_CLASS_CIV_MEDIUM, SHIP_CLASS_CIV_HEAVY }; typedef enum ship_class ship_class; // Small wrapper for the outfits. typedef struct ShipOutfit { struct ShipOutfit* next; // Linked list. Outfit* data; // Data itself. int quantity; } ShipOutfit; // Ship structure. typedef struct { char* name; // Ship name. ship_class class; // Ship class. // Movement. double thrust, turn, speed; // Graphics. gl_texture* gfx_space, *gfx_target; // GUI interface. char* gui; // Characteristics. int crew; int mass; // Health. double armor, armor_regen; double shield, shield_regen; double energy, energy_regen; // Capacity. int cap_cargo, cap_weapon; // Outfits ShipOutfit* outfit; } Ship; int ships_load(void); void ships_free(void); Ship* ship_get(const char* name);