Galactic Bloodshed
Macros | Functions | Variables
makestar.cc File Reference
#include "gb/creator/makestar.h"
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "gb/creator/makeplanet.h"
#include "gb/creator/makeuniv.h"
#include "gb/files.h"
#include "gb/files_shl.h"
#include "gb/tweakables.h"
#include "gb/utils/rand.h"
#include "gb/vars.h"
Include dependency graph for makestar.cc:

Go to the source code of this file.

Macros

#define M_PI   3.14159265358979323846
 

Functions

static char * NextStarName ()
 
static const char * NextPlanetName (int)
 
static int ReadNameList (char ss[1000][20], int n, int m, const char *filename)
 
static void rand_list (int n, int *list)
 
int Temperature (double dist, int stemp)
 
void PrintStatistics ()
 
void Makeplanet_init ()
 
void Makestar_init ()
 
startypeMakestar (int snum)
 

Variables

static const double PLANET_DIST_MAX = 1900.0
 
static const double PLANET_DIST_MIN = 100.0
 
static int Numtypes [PlanetType::DESERT+2]
 
static int Resource [PlanetType::DESERT+2]
 
static int Numsects [PlanetType::DESERT+2][SectorType::SEC_PLATED+1]
 
static int Fertsects [PlanetType::DESERT+2][SectorType::SEC_PLATED+1]
 
static int numplist
 
static int namepcount
 
static char PNames [1000][20]
 
static int planet_list [1000]
 
static int numslist
 
static int namestcount
 
static char SNames [1000][20]
 
static int star_list [1000]
 
static const char * Nametypes []
 

Macro Definition Documentation

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 31 of file makestar.cc.

Function Documentation

◆ Makeplanet_init()

void Makeplanet_init ( )

Definition at line 174 of file makestar.cc.

References namepcount, numplist, planet_list, and rand_list().

Referenced by main().

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

◆ Makestar()

startype* Makestar ( int  snum)

Definition at line 213 of file makestar.cc.

References Fertsects, getsmap(), Makeplanet(), maxplanets, minplanets, Nametypes, NextPlanetName(), NextStarName(), Numsects, Numtypes, place_star(), PLANET_DIST_MAX, PLANET_DIST_MIN, printplaninfo, printstarinfo, putplanet(), Resource, and Temperature().

Referenced by main().

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

◆ Makestar_init()

void Makestar_init ( )

Definition at line 190 of file makestar.cc.

References namestcount, numslist, rand_list(), and star_list.

Referenced by main().

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

◆ NextPlanetName()

static const char * NextPlanetName ( int  i)
static

Definition at line 181 of file makestar.cc.

References autoname_plan, namepcount, numplist, planet_list, and PNames.

Referenced by Makestar().

Here is the caller graph for this function:

◆ NextStarName()

static char * NextStarName ( )
static

Definition at line 197 of file makestar.cc.

References autoname_star, namestcount, numslist, SNames, and star_list.

Referenced by Makestar().

Here is the caller graph for this function:

◆ PrintStatistics()

void PrintStatistics ( )

Definition at line 72 of file makestar.cc.

References Fertsects, Nametypes, Numsects, Numtypes, and Resource.

Referenced by main().

Here is the caller graph for this function:

◆ rand_list()

static void rand_list ( int  n,
int *  list 
)
static

Definition at line 143 of file makestar.cc.

Referenced by Makeplanet_init(), and Makestar_init().

Here is the caller graph for this function:

◆ ReadNameList()

static int ReadNameList ( char  ss[1000][20],
int  n,
int  m,
const char *  filename 
)
static

Definition at line 116 of file makestar.cc.

◆ Temperature()

int Temperature ( double  dist,
int  stemp 
)

Definition at line 68 of file makestar.cc.

Referenced by Makeplanet(), and Makestar().

Here is the caller graph for this function:

Variable Documentation

◆ Fertsects

int Fertsects[PlanetType::DESERT+2][SectorType::SEC_PLATED+1]
static
Initial value:
= {
{
0,
},
}

Definition at line 48 of file makestar.cc.

Referenced by Makestar(), and PrintStatistics().

◆ namepcount

int namepcount
static

Definition at line 53 of file makestar.cc.

Referenced by Makeplanet_init(), and NextPlanetName().

◆ namestcount

int namestcount
static

Definition at line 56 of file makestar.cc.

Referenced by Makestar_init(), and NextStarName().

◆ Nametypes

const char* Nametypes[]
static
Initial value:
= {"Earth", "Asteroid", "Airless",
"Iceball", "Gaseous", "Water",
"Forest", "Desert", " >>"}

Definition at line 64 of file makestar.cc.

Referenced by Makestar(), and PrintStatistics().

◆ numplist

int numplist
static

Definition at line 53 of file makestar.cc.

Referenced by Makeplanet_init(), and NextPlanetName().

◆ Numsects

int Numsects[PlanetType::DESERT+2][SectorType::SEC_PLATED+1]
static
Initial value:
= {
{
0,
},
}

Definition at line 43 of file makestar.cc.

Referenced by Makestar(), and PrintStatistics().

◆ numslist

int numslist
static

Definition at line 56 of file makestar.cc.

Referenced by Makestar_init(), and NextStarName().

◆ Numtypes

int Numtypes[PlanetType::DESERT+2]
static
Initial value:
= {
0,
}

Definition at line 37 of file makestar.cc.

Referenced by Makestar(), and PrintStatistics().

◆ PLANET_DIST_MAX

const double PLANET_DIST_MAX = 1900.0
static

Definition at line 27 of file makestar.cc.

Referenced by Makestar().

◆ PLANET_DIST_MIN

const double PLANET_DIST_MIN = 100.0
static

Definition at line 28 of file makestar.cc.

Referenced by Makestar().

◆ planet_list

int planet_list[1000]
static

Definition at line 55 of file makestar.cc.

Referenced by Makeplanet_init(), and NextPlanetName().

◆ PNames

char PNames[1000][20]
static

Definition at line 54 of file makestar.cc.

Referenced by NextPlanetName().

◆ Resource

int Resource[PlanetType::DESERT+2]
static
Initial value:
= {
0,
}

Definition at line 40 of file makestar.cc.

Referenced by Makestar(), and PrintStatistics().

◆ SNames

char SNames[1000][20]
static

Definition at line 57 of file makestar.cc.

Referenced by NextStarName().

◆ star_list

int star_list[1000]
static

Definition at line 58 of file makestar.cc.

Referenced by Makestar_init(), and NextStarName().