Galactic Bloodshed
Namespaces | Functions
build.cc File Reference
#include "gb/build.h"
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctgmath>
#include <optional>
#include "gb/GB_server.h"
#include "gb/buffers.h"
#include "gb/config.h"
#include "gb/files.h"
#include "gb/files_shl.h"
#include "gb/fire.h"
#include "gb/getplace.h"
#include "gb/land.h"
#include "gb/races.h"
#include "gb/shipdata.h"
#include "gb/ships.h"
#include "gb/shlmisc.h"
#include "gb/shootblast.h"
#include "gb/tele.h"
#include "gb/tweakables.h"
#include "gb/vars.h"
Include dependency graph for build.cc:

Go to the source code of this file.

Namespaces

 anonymous_namespace{build.cc}
 

Functions

static void autoload_at_planet (int, Ship *, Planet *, Sector &, int *, double *)
 
static void autoload_at_ship (Ship *, Ship *, int *, double *)
 
static std::optional< ScopeLevelbuild_at_ship (GameObj &, Ship *, int *, int *)
 
static int can_build_at_planet (GameObj &, startype *, const Planet &)
 
static bool can_build_this (const ShipType, const Race &, char *)
 
static int can_build_on_ship (int, Race *, Ship *, char *)
 
static void create_ship_by_planet (int, int, Race *, Ship *, Planet *, int, int, int, int)
 
static void create_ship_by_ship (int, int, Race *, int, Planet *, Ship *, Ship *)
 
static std::optional< ShipTypeget_build_type (const char)
 
static int getcount (const command_t &, const size_t)
 
static void Getfactship (Ship *, Ship *)
 
static void Getship (Ship *, ShipType, Race *)
 
static void initialize_new_ship (GameObj &, Race *, Ship *, double, int)
 
bool anonymous_namespace{build.cc}::can_build_on_sector (const int what, const racetype *Race, const Planet &planet, const Sector &sector, const int x, const int y, char *string)
 
void upgrade (const command_t &argv, GameObj &g)
 
void make_mod (const command_t &argv, GameObj &g)
 
void build (const command_t &argv, GameObj &g)
 
static int can_build_on_ship (int what, racetype *Race, Ship *builder, char *string)
 
static void initialize_new_ship (GameObj &g, racetype *Race, Ship *newship, double load_fuel, int load_crew)
 
static void create_ship_by_planet (int Playernum, int Governor, racetype *Race, Ship *newship, Planet *planet, int snum, int pnum, int x, int y)
 
static void create_ship_by_ship (int Playernum, int Governor, racetype *Race, int outside, Planet *planet, Ship *newship, Ship *builder)
 
int Shipcost (ShipType i, Race *r)
 
void sell (const command_t &argv, GameObj &g)
 
void bid (const command_t &argv, GameObj &g)
 
int shipping_cost (int to, int from, double *dist, int value)
 

Function Documentation

◆ autoload_at_planet()

static void autoload_at_planet ( int  Playernum,
Ship s,
Planet planet,
Sector sector,
int *  crew,
double *  fuel 
)
static

Definition at line 1176 of file build.cc.

Referenced by build().

Here is the caller graph for this function:

◆ autoload_at_ship()

static void autoload_at_ship ( Ship s,
Ship b,
int *  crew,
double *  fuel 
)
static

Definition at line 1185 of file build.cc.

◆ bid()

void bid ( const command_t argv,
GameObj g 
)

Definition at line 1586 of file build.cc.

References getcommod(), getplanet(), Numcommods(), putcommod(), and shipping_cost().

Here is the call graph for this function:

◆ build()

void build ( const command_t argv,
GameObj g 
)

Definition at line 673 of file build.cc.

References autoload_at_planet(), can_build_at_planet(), create_ship_by_planet(), getplanet(), getsector(), initialize_new_ship(), putplanet(), putsdata(), putsector(), putship(), putstar(), and Shipcost().

Here is the call graph for this function:

◆ build_at_ship()

static std::optional< ScopeLevel > build_at_ship ( GameObj g,
Ship builder,
int *  snum,
int *  pnum 
)
static

Definition at line 1142 of file build.cc.

References docked().

Here is the call graph for this function:

◆ can_build_at_planet()

static int can_build_at_planet ( GameObj g,
startype star,
const Planet planet 
)
static

Definition at line 1073 of file build.cc.

Referenced by build().

Here is the caller graph for this function:

◆ can_build_on_ship() [1/2]

static int can_build_on_ship ( int  ,
Race ,
Ship ,
char *   
)
static

◆ can_build_on_ship() [2/2]

static int can_build_on_ship ( int  what,
racetype Race,
Ship builder,
char *  string 
)
static

Definition at line 1128 of file build.cc.

◆ can_build_this()

static bool can_build_this ( const ShipType  what,
const Race race,
char *  string 
)
static

Definition at line 1096 of file build.cc.

◆ create_ship_by_planet() [1/2]

static void create_ship_by_planet ( int  ,
int  ,
Race ,
Ship ,
Planet ,
int  ,
int  ,
int  ,
int   
)
static

◆ create_ship_by_planet() [2/2]

static void create_ship_by_planet ( int  Playernum,
int  Governor,
racetype Race,
Ship newship,
Planet planet,
int  snum,
int  pnum,
int  x,
int  y 
)
static

Definition at line 1275 of file build.cc.

References getdeadship(), and Numships().

Referenced by build().

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

◆ create_ship_by_ship() [1/2]

static void create_ship_by_ship ( int  ,
int  ,
Race ,
int  ,
Planet ,
Ship ,
Ship  
)
static

◆ create_ship_by_ship() [2/2]

static void create_ship_by_ship ( int  Playernum,
int  Governor,
racetype Race,
int  outside,
Planet planet,
Ship newship,
Ship builder 
)
static

Definition at line 1327 of file build.cc.

References getdeadship(), and Numships().

Here is the call graph for this function:

◆ get_build_type()

static std::optional< ShipType > get_build_type ( const char  shipc)
static

Definition at line 1089 of file build.cc.

◆ getcount()

static int getcount ( const command_t argv,
const size_t  elem 
)
static

Definition at line 1067 of file build.cc.

◆ Getfactship()

static void Getfactship ( Ship s,
Ship b 
)
static

Definition at line 1419 of file build.cc.

◆ Getship()

static void Getship ( Ship s,
ShipType  i,
Race r 
)
static

Definition at line 1389 of file build.cc.

Referenced by Shipcost().

Here is the caller graph for this function:

◆ initialize_new_ship() [1/2]

static void initialize_new_ship ( GameObj ,
Race ,
Ship ,
double  ,
int   
)
static

◆ initialize_new_ship() [2/2]

static void initialize_new_ship ( GameObj g,
racetype Race,
Ship newship,
double  load_fuel,
int  load_crew 
)
static

Definition at line 1192 of file build.cc.

References tele_range().

Referenced by build().

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

◆ make_mod()

void make_mod ( const command_t argv,
GameObj g 
)

Definition at line 317 of file build.cc.

◆ sell()

void sell ( const command_t argv,
GameObj g 
)

Definition at line 1455 of file build.cc.

References deductAPs(), enufAP(), getdeadcommod(), getplanet(), Numcommods(), post(), putcommod(), and putplanet().

Here is the call graph for this function:

◆ Shipcost()

int Shipcost ( ShipType  i,
Race r 
)

Definition at line 1447 of file build.cc.

References Getship().

Referenced by build().

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

◆ shipping_cost()

int shipping_cost ( int  to,
int  from,
double *  dist,
int  value 
)

Definition at line 1767 of file build.cc.

Referenced by bid(), and do_turn().

Here is the caller graph for this function:

◆ upgrade()

void upgrade ( const command_t argv,
GameObj g 
)

Definition at line 89 of file build.cc.