Galactic Bloodshed
Classes | Macros | Typedefs | Enumerations | Variables
vars.h File Reference
#include <sys/file.h>
#include <sys/types.h>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <string>
#include <vector>
#include "gb/config.h"
#include "gb/files.h"
#include "gb/tweakables.h"
#include "gb/gameobj.h"
Include dependency graph for vars.h:

Go to the source code of this file.

Classes

struct  plinfo
 
struct  commod
 
class  Planet
 
class  Sector
 
class  SectorMap
 
struct  star
 
struct  stardata
 
struct  directory
 
struct  vic
 

Macros

#define MAXPLAYERS   64
 
#define MAXSTRLEN   2047
 
#define HUGESTRLEN   (2 * MAXSTRLEN + 1)
 
#define M_FUEL   0x1
 
#define M_DESTRUCT   0x2
 
#define M_RESOURCES   0x4
 
#define M_CRYSTALS   0x8
 
#define Fuel(x)   ((x)&M_FUEL)
 
#define Destruct(x)   ((x)&M_DESTRUCT)
 
#define Resources(x)   ((x)&M_RESOURCES)
 
#define Crystals(x)   ((x)&M_CRYSTALS)
 
#define setbit(a, i)   ((a)[(i) / 32] |= ((i) < 32 ? 1 << (i) : 1 << ((i)-32)))
 
#define clrbit(a, i)   ((a)[(i) / 32] &= ~((i) < 32 ? 1 << (i) : 1 << ((i)-32)))
 
#define isset(a, i)   ((a)[(i) / 32] & ((i) < 32 ? 1 << (i) : 1 << ((i)-32)))
 
#define isclr(a, i)   (!isset((a), (i)))
 

Typedefs

using shipnum_t = uint64_t
 
using starnum_t = uint8_t
 
using planetnum_t = uint8_t
 
using player_t = uint8_t
 
using governor_t = uint8_t
 
using commodnum_t = uint64_t
 
using resource_t = unsigned long
 
using money_t = int64_t
 
using population_t = uint64_t
 
using command_t = std::vector< std::string >
 
typedef char hugestr[HUGESTRLEN]
 
using planettype = class Planet
 
using startype = struct star
 
using commodtype = struct commod
 

Enumerations

enum  ScopeLevel { LEVEL_UNIV, LEVEL_STAR, LEVEL_PLAN, LEVEL_SHIP }
 

Variables

unsigned long segments
 
constexpr int MAX_ROUTES = 4
 
struct stardata Sdata
 
unsigned char Nuked [MAXPLAYERS]
 
unsigned long StarsInhab [NUMSTARS]
 
unsigned long StarsExpl [NUMSTARS]
 
startypeStars [NUMSTARS]
 
unsigned short Sdatanumships [MAXPLAYERS]
 
unsigned long Sdatapopns [MAXPLAYERS]
 
unsigned short starnumships [NUMSTARS][MAXPLAYERS]
 
unsigned long starpopns [NUMSTARS][MAXPLAYERS]
 
unsigned long tot_resdep
 
unsigned long prod_eff
 
unsigned long prod_res [MAXPLAYERS]
 
unsigned long prod_fuel [MAXPLAYERS]
 
unsigned long prod_destruct [MAXPLAYERS]
 
unsigned long prod_crystals [MAXPLAYERS]
 
unsigned long prod_money [MAXPLAYERS]
 
unsigned long tot_captured
 
unsigned long prod_mob
 
unsigned long avg_mob [MAXPLAYERS]
 
unsigned char sects_gained [MAXPLAYERS]
 
unsigned char sects_lost [MAXPLAYERS]
 
unsigned char Claims
 
planettypeplanets [NUMSTARS][MAXPLANETS]
 
unsigned char ground_assaults [MAXPLAYERS][MAXPLAYERS][NUMSTARS]
 
unsigned long inhabited [NUMSTARS][2]
 
double Compat [MAXPLAYERS]
 
player_t Num_races
 
unsigned long Num_commods
 
planetnum_t Planet_count
 
unsigned long newslength [4]
 

Macro Definition Documentation

◆ clrbit

#define clrbit (   a,
 
)    ((a)[(i) / 32] &= ~((i) < 32 ? 1 << (i) : 1 << ((i)-32)))

Definition at line 311 of file vars.h.

◆ Crystals

#define Crystals (   x)    ((x)&M_CRYSTALS)

Definition at line 105 of file vars.h.

◆ Destruct

#define Destruct (   x)    ((x)&M_DESTRUCT)

Definition at line 103 of file vars.h.

◆ Fuel

#define Fuel (   x)    ((x)&M_FUEL)

Definition at line 102 of file vars.h.

◆ HUGESTRLEN

#define HUGESTRLEN   (2 * MAXSTRLEN + 1)

Definition at line 47 of file vars.h.

◆ isclr

#define isclr (   a,
 
)    (!isset((a), (i)))

Definition at line 313 of file vars.h.

◆ isset

#define isset (   a,
 
)    ((a)[(i) / 32] & ((i) < 32 ? 1 << (i) : 1 << ((i)-32)))

Definition at line 312 of file vars.h.

◆ M_CRYSTALS

#define M_CRYSTALS   0x8

Definition at line 101 of file vars.h.

◆ M_DESTRUCT

#define M_DESTRUCT   0x2

Definition at line 99 of file vars.h.

◆ M_FUEL

#define M_FUEL   0x1

Definition at line 98 of file vars.h.

◆ M_RESOURCES

#define M_RESOURCES   0x4

Definition at line 100 of file vars.h.

◆ MAXPLAYERS

#define MAXPLAYERS   64

Definition at line 45 of file vars.h.

◆ MAXSTRLEN

#define MAXSTRLEN   2047

Definition at line 46 of file vars.h.

◆ Resources

#define Resources (   x)    ((x)&M_RESOURCES)

Definition at line 104 of file vars.h.

◆ setbit

#define setbit (   a,
 
)    ((a)[(i) / 32] |= ((i) < 32 ? 1 << (i) : 1 << ((i)-32)))

Definition at line 310 of file vars.h.

Typedef Documentation

◆ command_t

using command_t = std::vector<std::string>

Definition at line 43 of file vars.h.

◆ commodnum_t

using commodnum_t = uint64_t

Definition at line 37 of file vars.h.

◆ commodtype

using commodtype = struct commod

Definition at line 53 of file vars.h.

◆ governor_t

using governor_t = uint8_t

Definition at line 36 of file vars.h.

◆ hugestr

typedef char hugestr[HUGESTRLEN]

Definition at line 49 of file vars.h.

◆ money_t

using money_t = int64_t

Definition at line 40 of file vars.h.

◆ planetnum_t

using planetnum_t = uint8_t

Definition at line 34 of file vars.h.

◆ planettype

using planettype = class Planet

Definition at line 51 of file vars.h.

◆ player_t

using player_t = uint8_t

Definition at line 35 of file vars.h.

◆ population_t

using population_t = uint64_t

Definition at line 41 of file vars.h.

◆ resource_t

using resource_t = unsigned long

Definition at line 38 of file vars.h.

◆ shipnum_t

using shipnum_t = uint64_t

Definition at line 32 of file vars.h.

◆ starnum_t

using starnum_t = uint8_t

Definition at line 33 of file vars.h.

◆ startype

using startype = struct star

Definition at line 52 of file vars.h.

Enumeration Type Documentation

◆ ScopeLevel

enum ScopeLevel
Enumerator
LEVEL_UNIV 
LEVEL_STAR 
LEVEL_PLAN 
LEVEL_SHIP 

Definition at line 30 of file vars.h.

Variable Documentation

◆ avg_mob

unsigned long avg_mob[MAXPLAYERS]

Definition at line 76 of file globals.h.

◆ Claims

unsigned char Claims

Definition at line 78 of file globals.h.

◆ Compat

double Compat[MAXPLAYERS]

Definition at line 83 of file globals.h.

◆ ground_assaults

unsigned char ground_assaults[MAXPLAYERS][MAXPLAYERS][NUMSTARS]

Definition at line 81 of file globals.h.

◆ inhabited

unsigned long inhabited[NUMSTARS][2]

Definition at line 82 of file globals.h.

◆ MAX_ROUTES

constexpr int MAX_ROUTES = 4

Definition at line 28 of file vars.h.

◆ newslength

unsigned long newslength[4]

Definition at line 88 of file globals.h.

◆ Nuked

unsigned char Nuked[MAXPLAYERS]

Definition at line 63 of file globals.h.

◆ Num_commods

unsigned long Num_commods

Definition at line 85 of file globals.h.

◆ Num_races

player_t Num_races

Definition at line 84 of file globals.h.

◆ Planet_count

planetnum_t Planet_count

Definition at line 87 of file globals.h.

◆ planets

Definition at line 80 of file globals.h.

◆ prod_crystals

unsigned long prod_crystals[MAXPLAYERS]

Definition at line 74 of file globals.h.

◆ prod_destruct

unsigned long prod_destruct[MAXPLAYERS]

Definition at line 73 of file globals.h.

◆ prod_eff

unsigned long prod_eff

Definition at line 72 of file globals.h.

◆ prod_fuel

unsigned long prod_fuel[MAXPLAYERS]

Definition at line 73 of file globals.h.

◆ prod_mob

unsigned long prod_mob

Definition at line 75 of file globals.h.

◆ prod_money

unsigned long prod_money[MAXPLAYERS]

Definition at line 74 of file globals.h.

◆ prod_res

unsigned long prod_res[MAXPLAYERS]

Definition at line 72 of file globals.h.

◆ Sdata

struct stardata Sdata

Definition at line 61 of file globals.h.

◆ Sdatanumships

unsigned short Sdatanumships[MAXPLAYERS]

Definition at line 67 of file globals.h.

◆ Sdatapopns

unsigned long Sdatapopns[MAXPLAYERS]

Definition at line 68 of file globals.h.

◆ sects_gained

unsigned char sects_gained[MAXPLAYERS]

Definition at line 77 of file globals.h.

◆ sects_lost

unsigned char sects_lost[MAXPLAYERS]

Definition at line 77 of file globals.h.

◆ segments

unsigned long segments

Definition at line 90 of file globals.h.

◆ starnumships

unsigned short starnumships[NUMSTARS][MAXPLAYERS]

Definition at line 69 of file globals.h.

◆ starpopns

unsigned long starpopns[NUMSTARS][MAXPLAYERS]

Definition at line 70 of file globals.h.

◆ Stars

startype* Stars[NUMSTARS]

Definition at line 66 of file globals.h.

◆ StarsExpl

unsigned long StarsExpl[NUMSTARS]

Definition at line 65 of file globals.h.

◆ StarsInhab

unsigned long StarsInhab[NUMSTARS]

Definition at line 64 of file globals.h.

◆ tot_captured

unsigned long tot_captured

Definition at line 75 of file globals.h.

◆ tot_resdep

unsigned long tot_resdep

Definition at line 72 of file globals.h.