Galactic Bloodshed
Classes | Functions
files_shl.h File Reference
#include <cstdint>
#include <memory>
#include <optional>
#include "gb/races.h"
#include "gb/ships.h"
#include "gb/sql/dbdecl.h"
#include "gb/vars.h"
Include dependency graph for files_shl.h:

Go to the source code of this file.

Classes

class  Db
 

Functions

void close_file (int)
 
void openstardata (int *)
 
void openshdata (int *)
 
void opencommoddata (int *)
 
void opensectdata (int *)
 
void openracedata (int *)
 
void getsdata (struct stardata *S)
 
void getrace (Race **, int)
 
void getstar (startype **, int)
 
Planet getplanet (const starnum_t, const planetnum_t)
 
std::optional< Shipgetship (const shipnum_t)
 
std::optional< Shipgetship (Ship **, const shipnum_t)
 
int getcommod (commodtype **, commodnum_t)
 
Sector getsector (const Planet &, const int x, const int y)
 
SectorMap getsmap (const Planet &)
 
int getdeadship ()
 
int getdeadcommod ()
 
void initsqldata ()
 
void putsdata (struct stardata *)
 
void putrace (Race *)
 
void putstar (startype *, starnum_t)
 
void putplanet (const Planet &, startype *, const int)
 
void putsector (const Sector &, const Planet &, const int x, const int y)
 
void putsmap (SectorMap &map, Planet &p)
 
void putship (Ship *)
 
void putcommod (commodtype *, int)
 
int Numraces ()
 
shipnum_t Numships ()
 
int Numcommods ()
 
int Newslength (int)
 
void clr_shipfree ()
 
void clr_commodfree ()
 
void makeshipdead (int)
 
void makecommoddead (int)
 
void Putpower (struct power[MAXPLAYERS])
 
void Getpower (struct power[MAXPLAYERS])
 
void Putblock (struct block[MAXPLAYERS])
 
void Getblock (struct block[MAXPLAYERS])
 

Function Documentation

◆ close_file()

void close_file ( int  )

Definition at line 40 of file files_shl.cc.

Referenced by Getblock(), getdeadcommod(), getdeadship(), Getpower(), makecommoddead(), makeshipdead(), Putblock(), Putpower(), and Db::~Db().

Here is the caller graph for this function:

◆ clr_commodfree()

void clr_commodfree ( )

Definition at line 1572 of file files_shl.cc.

Referenced by do_turn().

Here is the caller graph for this function:

◆ clr_shipfree()

void clr_shipfree ( )

Definition at line 1570 of file files_shl.cc.

Referenced by do_turn().

Here is the caller graph for this function:

◆ Getblock()

void Getblock ( struct block  [MAXPLAYERS])

Definition at line 1661 of file files_shl.cc.

References close_file().

Here is the call graph for this function:

◆ getcommod()

int getcommod ( commodtype **  ,
commodnum_t   
)

Definition at line 730 of file files_shl.cc.

References commoddata.

Referenced by bid(), and do_turn().

Here is the caller graph for this function:

◆ getdeadcommod()

int getdeadcommod ( )

Definition at line 777 of file files_shl.cc.

References close_file().

Referenced by sell().

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

◆ getdeadship()

int getdeadship ( )

Definition at line 751 of file files_shl.cc.

References close_file().

Referenced by create_ship_by_planet(), and create_ship_by_ship().

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

◆ getplanet()

Planet getplanet ( const starnum_t  ,
const planetnum_t   
)

◆ Getpower()

void Getpower ( struct power  [MAXPLAYERS])

Definition at line 1637 of file files_shl.cc.

References close_file().

Here is the call graph for this function:

◆ getrace()

void getrace ( Race **  ,
int   
)

Definition at line 276 of file files_shl.cc.

References racedata.

◆ getsdata()

void getsdata ( struct stardata S)

Definition at line 272 of file files_shl.cc.

References stdata.

Referenced by allocateAPs(), colonies(), deductAPs(), dissolve(), do_turn(), dump(), enroll_valid_race(), exploration(), launch(), main(), production(), start_shiplist(), and tech_status().

Here is the caller graph for this function:

◆ getsector()

Sector getsector ( const Planet ,
const int  x,
const int  y 
)

Definition at line 480 of file files_shl.cc.

References dbconn.

Referenced by arm(), build(), capture(), defend(), do_merchant(), land(), load(), move_popn(), scrap(), and walk().

Here is the caller graph for this function:

◆ getship() [1/2]

std::optional<Ship> getship ( const shipnum_t  )

Definition at line 560 of file files_shl.cc.

◆ getship() [2/2]

std::optional<Ship> getship ( Ship **  ,
const shipnum_t   
)

Definition at line 564 of file files_shl.cc.

References dbconn, and shdata.

◆ getsmap()

SectorMap getsmap ( const Planet )

Definition at line 522 of file files_shl.cc.

References dbconn.

Referenced by bombard(), defend(), dissolve(), do_analysis(), do_meta_infect(), domissile(), doplanet(), enroll_valid_race(), land(), main(), Makestar(), repair(), revolt(), show_map(), and survey().

Here is the caller graph for this function:

◆ getstar()

void getstar ( startype **  ,
int   
)

Definition at line 281 of file files_shl.cc.

References dbconn, and stdata.

Referenced by allocateAPs(), bless(), anonymous_namespace{colonies.cc}::colonies_at_star(), deductAPs(), dissolve(), do_turn(), dump(), enroll_valid_race(), exploration(), main(), mk_expl_aimed_at(), name(), page(), anonymous_namespace{production.cc}::production_at_star(), send_message(), start_shiplist(), and tech_status().

Here is the caller graph for this function:

◆ initsqldata()

void initsqldata ( )

Definition at line 42 of file files_shl.cc.

References dbconn.

Referenced by main().

Here is the caller graph for this function:

◆ makecommoddead()

void makecommoddead ( int  )

Definition at line 1601 of file files_shl.cc.

References close_file().

Referenced by do_turn().

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

◆ makeshipdead()

void makeshipdead ( int  )

Definition at line 1577 of file files_shl.cc.

References close_file().

Referenced by do_turn().

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

◆ Newslength()

int Newslength ( int  )

Definition at line 1540 of file files_shl.cc.

◆ Numcommods()

int Numcommods ( )

Definition at line 1533 of file files_shl.cc.

References commoddata.

Referenced by bid(), do_turn(), and sell().

Here is the caller graph for this function:

◆ Numraces()

int Numraces ( )

Definition at line 1509 of file files_shl.cc.

References racedata.

Referenced by enroll_valid_race(), and main().

Here is the caller graph for this function:

◆ Numships()

shipnum_t Numships ( )

Definition at line 1516 of file files_shl.cc.

References dbconn.

Referenced by create_ship_by_planet(), create_ship_by_ship(), dissolve(), do_trip(), do_turn(), enroll_valid_race(), main(), and rst().

Here is the caller graph for this function:

◆ opencommoddata()

void opencommoddata ( int *  )

Definition at line 256 of file files_shl.cc.

Referenced by Db::Db().

Here is the caller graph for this function:

◆ openracedata()

void openracedata ( int *  )

Definition at line 264 of file files_shl.cc.

Referenced by Db::Db().

Here is the caller graph for this function:

◆ opensectdata()

void opensectdata ( int *  )

◆ openshdata()

void openshdata ( int *  )

Definition at line 248 of file files_shl.cc.

Referenced by Db::Db().

Here is the caller graph for this function:

◆ openstardata()

void openstardata ( int *  )

Definition at line 239 of file files_shl.cc.

Referenced by Db::Db().

Here is the caller graph for this function:

◆ Putblock()

void Putblock ( struct block  [MAXPLAYERS])

Definition at line 1649 of file files_shl.cc.

References close_file().

Referenced by do_turn(), invite(), motto(), name(), and pledge().

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

◆ putcommod()

void putcommod ( commodtype ,
int   
)

Definition at line 1504 of file files_shl.cc.

References commoddata.

Referenced by bid(), do_turn(), and sell().

Here is the caller graph for this function:

◆ putplanet()

void putplanet ( const Planet ,
startype ,
const int   
)

Definition at line 934 of file files_shl.cc.

References dbconn, end_bulk_insert(), and start_bulk_insert().

Referenced by arm(), bless(), bombard(), build(), capture(), defend(), dissolve(), do_turn(), dump(), enroll_valid_race(), fix(), give_orders(), land(), launch(), load(), main(), Makestar(), mk_expl_aimed_at(), mobilize(), move_popn(), repair(), route(), scrap(), sell(), tax(), technology(), toxicity(), transfer(), and walk().

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

◆ Putpower()

void Putpower ( struct power  [MAXPLAYERS])

Definition at line 1625 of file files_shl.cc.

References close_file().

Referenced by do_turn().

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

◆ putrace()

void putrace ( Race )

Definition at line 808 of file files_shl.cc.

References racedata.

Referenced by arm(), bless(), capital(), capture(), cs(), declare(), dissolve(), enroll_valid_race(), grant(), highlight(), insurgency(), main(), move_popn(), name(), news_read(), pay(), send_message(), toggle(), unload_onto_alien_sector(), vote(), and walk().

Here is the caller graph for this function:

◆ putsdata()

void putsdata ( struct stardata )

Definition at line 804 of file files_shl.cc.

References stdata.

Referenced by allocateAPs(), build(), deductAPs(), do_turn(), launch(), and main().

Here is the caller graph for this function:

◆ putsector()

void putsector ( const Sector ,
const Planet ,
const int  x,
const int  y 
)

Definition at line 1076 of file files_shl.cc.

References dbconn.

Referenced by arm(), build(), capture(), enroll_valid_race(), land(), load(), main(), move_popn(), putsmap(), repair(), scrap(), and walk().

Here is the caller graph for this function:

◆ putship()

void putship ( Ship )

Definition at line 1317 of file files_shl.cc.

References dbconn, end_bulk_insert(), putship_aimed(), putship_impact(), putship_mind(), putship_pod(), putship_terraform(), putship_timer(), putship_transport(), putship_trigger(), putship_waste(), shdata, and start_bulk_insert().

Referenced by bombard(), build(), capture(), defend(), do_transporter(), do_turn(), domine(), enroll_valid_race(), fire(), give_orders(), grant(), jettison(), land(), launch(), load(), main(), mech_defend(), mount(), scrap(), and walk().

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

◆ putsmap()

void putsmap ( SectorMap map,
Planet p 
)

Definition at line 1108 of file files_shl.cc.

References end_bulk_insert(), putsector(), and start_bulk_insert().

Referenced by bombard(), defend(), dissolve(), do_meta_infect(), domissile(), doplanet(), land(), Makeplanet(), and revolt().

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

◆ putstar()

void putstar ( startype ,
starnum_t   
)

Definition at line 813 of file files_shl.cc.

References dbconn, end_bulk_insert(), start_bulk_insert(), and stdata.

Referenced by allocateAPs(), bless(), build(), deductAPs(), dissolve(), do_turn(), dump(), enroll_valid_race(), grant(), main(), mk_expl_aimed_at(), and name().

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