Galactic Bloodshed
Classes | Macros | Typedefs | Enumerations | Functions | Variables
ships.h File Reference
#include <cstdint>
#include <string>
#include "gb/vars.h"
Include dependency graph for ships.h:

Go to the source code of this file.

Classes

class  Ship
 
class  Shiplist
 
class  Shiplist::Iterator
 
struct  place
 

Macros

#define PRIMARY   1
 
#define SECONDARY   2
 
#define NUMSTYPES   (ShipType::STYPE_LANDER + 1)
 
#define NUMABILS   (ABIL_MAINTAIN + 1)
 
#define SHIP_NAMESIZE   18
 

Typedefs

using placetype = struct place
 

Enumerations

enum  guntype_t { GTYPE_NONE, GTYPE_LIGHT, GTYPE_MEDIUM, GTYPE_HEAVY }
 
enum  ShipType : int {
  STYPE_POD, STYPE_SHUTTLE, STYPE_CARRIER, STYPE_DREADNT,
  STYPE_BATTLE, STYPE_INTCPT, STYPE_CRUISER, STYPE_DESTROYER,
  STYPE_FIGHTER, STYPE_EXPLORER, STYPE_HABITAT, STYPE_STATION,
  STYPE_OAP, STYPE_CARGO, STYPE_TANKER, STYPE_GOD,
  STYPE_MINE, STYPE_MIRROR, OTYPE_STELE, OTYPE_GTELE,
  OTYPE_TRACT, OTYPE_AP, OTYPE_CANIST, OTYPE_GREEN,
  OTYPE_VN, OTYPE_BERS, OTYPE_GOV, OTYPE_OMCL,
  OTYPE_TOXWC, OTYPE_PROBE, OTYPE_GR, OTYPE_FACTORY,
  OTYPE_TERRA, OTYPE_BERSCTLC, OTYPE_AUTOFAC, OTYPE_TRANSDEV,
  STYPE_MISSILE, OTYPE_PLANDEF, OTYPE_QUARRY, OTYPE_PLOW,
  OTYPE_DOME, OTYPE_WPLANT, OTYPE_PORT, OTYPE_ABM,
  OTYPE_AFV, OTYPE_BUNKER, STYPE_LANDER
}
 
enum  abil_t {
  ABIL_TECH, ABIL_CARGO, ABIL_HANGER, ABIL_DESTCAP,
  ABIL_GUNS, ABIL_PRIMARY, ABIL_SECONDARY, ABIL_FUELCAP,
  ABIL_MAXCREW, ABIL_ARMOR, ABIL_COST, ABIL_MOUNT,
  ABIL_JUMP, ABIL_CANLAND, ABIL_HASSWITCH, ABIL_SPEED,
  ABIL_DAMAGE, ABIL_BUILD, ABIL_CONSTRUCT, ABIL_MOD,
  ABIL_LASER, ABIL_CEW, ABIL_CLOAK, ABIL_GOD,
  ABIL_PROGRAMMED, ABIL_PORT, ABIL_REPAIR, ABIL_MAINTAIN
}
 

Functions

unsigned short speed_rating (const Ship &s)
 
bool has_switch (const Ship &d)
 
bool can_bombard (const Ship &s)
 
bool can_navigate (const Ship &s)
 
bool can_aim (const Ship &s)
 
unsigned long armor (const Ship &s)
 
long guns (const Ship &s)
 
population_t max_crew (const Ship &s)
 
population_t max_mil (const Ship &s)
 
long max_resource (const Ship &s)
 
int max_crystals (const Ship &s)
 
long max_fuel (const Ship &s)
 
long max_destruct (const Ship &s)
 
long max_speed (const Ship &s)
 
long shipcost (const Ship &s)
 
double mass (const Ship &s)
 
long shipsight (const Ship &s)
 
long retaliate (const Ship &s)
 
int size (const Ship &s)
 
int shipbody (const Ship &s)
 
long hanger (const Ship &s)
 
long repair (const Ship &s)
 
int getdefense (const Ship &)
 
bool landed (const Ship &)
 
bool laser_on (const Ship &)
 
void capture_stuff (const Ship &, GameObj &)
 
std::string ship_to_string (const Ship &)
 
double cost (const Ship &)
 
double getmass (const Ship &)
 
unsigned int ship_size (const Ship &)
 
double complexity (const Ship &)
 

Variables

shipnum_t Num_ships
 
const unsigned long Shipdata [NUMSTYPES][NUMABILS]
 
const char Shipltrs []
 
const char * Shipnames []
 
int ShipVector [NUMSTYPES]
 
Ship ** ships
 

Macro Definition Documentation

◆ NUMABILS

#define NUMABILS   (ABIL_MAINTAIN + 1)

Definition at line 100 of file ships.h.

◆ NUMSTYPES

#define NUMSTYPES   (ShipType::STYPE_LANDER + 1)

Definition at line 99 of file ships.h.

◆ PRIMARY

#define PRIMARY   1

Definition at line 15 of file ships.h.

◆ SECONDARY

#define SECONDARY   2

Definition at line 16 of file ships.h.

◆ SHIP_NAMESIZE

#define SHIP_NAMESIZE   18

Definition at line 102 of file ships.h.

Typedef Documentation

◆ placetype

using placetype = struct place

Definition at line 104 of file ships.h.

Enumeration Type Documentation

◆ abil_t

enum abil_t
Enumerator
ABIL_TECH 
ABIL_CARGO 
ABIL_HANGER 
ABIL_DESTCAP 
ABIL_GUNS 
ABIL_PRIMARY 
ABIL_SECONDARY 
ABIL_FUELCAP 
ABIL_MAXCREW 
ABIL_ARMOR 
ABIL_COST 
ABIL_MOUNT 
ABIL_JUMP 
ABIL_CANLAND 
ABIL_HASSWITCH 
ABIL_SPEED 
ABIL_DAMAGE 
ABIL_BUILD 
ABIL_CONSTRUCT 
ABIL_MOD 
ABIL_LASER 
ABIL_CEW 
ABIL_CLOAK 
ABIL_GOD 
ABIL_PROGRAMMED 
ABIL_PORT 
ABIL_REPAIR 
ABIL_MAINTAIN 

Definition at line 68 of file ships.h.

◆ guntype_t

enum guntype_t
Enumerator
GTYPE_NONE 
GTYPE_LIGHT 
GTYPE_MEDIUM 
GTYPE_HEAVY 

Definition at line 13 of file ships.h.

◆ ShipType

enum ShipType : int
Enumerator
STYPE_POD 
STYPE_SHUTTLE 
STYPE_CARRIER 
STYPE_DREADNT 
STYPE_BATTLE 
STYPE_INTCPT 
STYPE_CRUISER 
STYPE_DESTROYER 
STYPE_FIGHTER 
STYPE_EXPLORER 
STYPE_HABITAT 
STYPE_STATION 
STYPE_OAP 
STYPE_CARGO 
STYPE_TANKER 
STYPE_GOD 
STYPE_MINE 
STYPE_MIRROR 
OTYPE_STELE 
OTYPE_GTELE 
OTYPE_TRACT 
OTYPE_AP 
OTYPE_CANIST 
OTYPE_GREEN 
OTYPE_VN 
OTYPE_BERS 
OTYPE_GOV 
OTYPE_OMCL 
OTYPE_TOXWC 
OTYPE_PROBE 
OTYPE_GR 
OTYPE_FACTORY 
OTYPE_TERRA 
OTYPE_BERSCTLC 
OTYPE_AUTOFAC 
OTYPE_TRANSDEV 
STYPE_MISSILE 
OTYPE_PLANDEF 
OTYPE_QUARRY 
OTYPE_PLOW 
OTYPE_DOME 
OTYPE_WPLANT 
OTYPE_PORT 
OTYPE_ABM 
OTYPE_AFV 
OTYPE_BUNKER 
STYPE_LANDER 

Definition at line 18 of file ships.h.

Function Documentation

◆ armor()

unsigned long armor ( const Ship s)

Definition at line 38 of file ships.cc.

◆ can_aim()

bool can_aim ( const Ship s)

Definition at line 33 of file ships.cc.

◆ can_bombard()

bool can_bombard ( const Ship s)

Definition at line 22 of file ships.cc.

◆ can_navigate()

bool can_navigate ( const Ship s)

Definition at line 27 of file ships.cc.

◆ capture_stuff()

void capture_stuff ( const Ship ,
GameObj  
)

Definition at line 142 of file ships.cc.

References capture_stuff().

Referenced by capture_stuff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ complexity()

double complexity ( const Ship )

Definition at line 211 of file ships.cc.

References anonymous_namespace{ships.cc}::system_cost().

Here is the call graph for this function:

◆ cost()

double cost ( const Ship )

Definition at line 172 of file ships.cc.

◆ getdefense()

int getdefense ( const Ship )

Definition at line 126 of file ships.cc.

References landed().

Here is the call graph for this function:

◆ getmass()

double getmass ( const Ship )

Definition at line 158 of file ships.cc.

◆ guns()

long guns ( const Ship s)

Definition at line 43 of file ships.cc.

◆ hanger()

long hanger ( const Ship s)

Definition at line 99 of file ships.cc.

◆ has_switch()

bool has_switch ( const Ship d)

Definition at line 19 of file ships.cc.

◆ landed()

bool landed ( const Ship )

Definition at line 138 of file ships.cc.

Referenced by getdefense().

Here is the caller graph for this function:

◆ laser_on()

bool laser_on ( const Ship )

Definition at line 136 of file ships.cc.

◆ mass()

double mass ( const Ship s)

Definition at line 87 of file ships.cc.

◆ max_crew()

population_t max_crew ( const Ship s)

Definition at line 48 of file ships.cc.

Referenced by repair().

Here is the caller graph for this function:

◆ max_crystals()

int max_crystals ( const Ship s)

Definition at line 64 of file ships.cc.

◆ max_destruct()

long max_destruct ( const Ship s)

Definition at line 71 of file ships.cc.

◆ max_fuel()

long max_fuel ( const Ship s)

Definition at line 66 of file ships.cc.

◆ max_mil()

population_t max_mil ( const Ship s)

Definition at line 54 of file ships.cc.

◆ max_resource()

long max_resource ( const Ship s)

Definition at line 60 of file ships.cc.

◆ max_speed()

long max_speed ( const Ship s)

Definition at line 76 of file ships.cc.

◆ repair()

long repair ( const Ship s)

Definition at line 101 of file ships.cc.

References max_crew().

Here is the call graph for this function:

◆ retaliate()

long retaliate ( const Ship s)

Definition at line 93 of file ships.cc.

◆ ship_size()

unsigned int ship_size ( const Ship )

Definition at line 164 of file ships.cc.

◆ ship_to_string()

std::string ship_to_string ( const Ship )

Definition at line 153 of file ships.cc.

◆ shipbody()

int shipbody ( const Ship s)

Definition at line 97 of file ships.cc.

◆ shipcost()

long shipcost ( const Ship s)

Definition at line 81 of file ships.cc.

◆ shipsight()

long shipsight ( const Ship s)

Definition at line 89 of file ships.cc.

◆ size()

int size ( const Ship s)

Definition at line 95 of file ships.cc.

◆ speed_rating()

unsigned short speed_rating ( const Ship s)

Definition at line 16 of file ships.cc.

Variable Documentation

◆ Num_ships

shipnum_t Num_ships

Definition at line 86 of file globals.h.

◆ Shipdata

const unsigned long Shipdata[NUMSTYPES][NUMABILS]

Definition at line 51 of file shipdata.h.

◆ Shipltrs

const char Shipltrs[]

Definition at line 8 of file shipdata.h.

◆ Shipnames

const char* Shipnames[]

Definition at line 158 of file shipdata.h.

◆ ships

Ship** ships

Definition at line 32 of file globals.h.

◆ ShipVector

int ShipVector[NUMSTYPES]

Definition at line 31 of file globals.h.