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

Go to the source code of this file.

Functions

static int neighbors (SectorMap &smap, int x, int y, int type)
 Returns # of neighbors of a given designation that a sector has. More...
 
static void MakeEarthAtmosphere (Planet &, int)
 
static void Makesurface (const Planet &, SectorMap &)
 
static int SectTemp (const Planet &, const int)
 
static void seed (SectorMap &smap, int type, int n)
 Randomly places n sectors of designation type on a planet. More...
 
static void grow (SectorMap &, int, int, int)
 
Planet Makeplanet (double dist, short stemp, PlanetType type)
 

Variables

static const int xmin [] = {15, 2, 4, 4, 26, 12, 12, 12}
 
static const int xmax [] = {23, 4, 8, 8, 32, 20, 20, 20}
 
static const int x_chance [] = {5, 15, 10, 4, 5, 7, 6}
 
static const int Fmin [][8]
 
static const int Fmax [][8]
 
static const int rmin [][8]
 
static const int rmax [][8]
 
static const int cond []
 

Function Documentation

◆ grow()

static void grow ( SectorMap smap,
int  type,
int  n,
int  rate 
)
static

Spread out a sector of a certain type over the planet. Rate is the number of adjacent sectors of the same type that must be found for the sector to become type.

Definition at line 298 of file makeplanet.cc.

References neighbors().

Referenced by Makeplanet().

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

◆ MakeEarthAtmosphere()

static void MakeEarthAtmosphere ( Planet planet,
int  chance 
)
static

Definition at line 237 of file makeplanet.cc.

Referenced by Makeplanet().

Here is the caller graph for this function:

◆ Makeplanet()

Planet Makeplanet ( double  dist,
short  stemp,
PlanetType  type 
)

Definition at line 86 of file makeplanet.cc.

References cond, grow(), MakeEarthAtmosphere(), Makesurface(), putsmap(), seed(), Temperature(), xmax, and xmin.

Referenced by Makestar().

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

◆ Makesurface()

static void Makesurface ( const Planet p,
SectorMap smap 
)
static

Definition at line 320 of file makeplanet.cc.

References Fmax, Fmin, rmax, rmin, SectTemp(), and x_chance.

Referenced by Makeplanet().

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

◆ neighbors()

static int neighbors ( SectorMap smap,
int  x,
int  y,
int  type 
)
static

Returns # of neighbors of a given designation that a sector has.

Definition at line 264 of file makeplanet.cc.

Referenced by grow().

Here is the caller graph for this function:

◆ SectTemp()

int SectTemp ( const Planet p,
const int  y 
)
static

Definition at line 353 of file makeplanet.cc.

Referenced by Makesurface().

Here is the caller graph for this function:

◆ seed()

static void seed ( SectorMap smap,
int  type,
int  n 
)
static

Randomly places n sectors of designation type on a planet.

Definition at line 287 of file makeplanet.cc.

Referenced by Makeplanet().

Here is the caller graph for this function:

Variable Documentation

◆ cond

const int cond[]
static

◆ Fmax

const int Fmax[][8]
static
Initial value:
= {{40, 35, 20, 0, 40, 65, 15},
{0, 2, 3, 0, 0, 0, 2},
{0, 5, 4, 0, 0, 0, 3},
{0, 0, 15, 0, 35, 0, 0},
{0, 0, 0, 55, 0, 0, 0},
{50, 0, 0, 0, 40, 0, 0},
{60, 45, 30, 0, 50, 90, 25},
{0, 10, 6, 0, 0, 0, 8}}

Definition at line 43 of file makeplanet.cc.

Referenced by Makesurface().

◆ Fmin

const int Fmin[][8]
static
Initial value:
= {{25, 20, 10, 0, 20, 45, 5},
{0, 1, 2, 0, 0, 0, 1},
{0, 3, 2, 0, 0, 0, 2},
{0, 0, 8, 0, 25, 0, 0},
{0, 0, 0, 35, 0, 0, 0},
{30, 0, 0, 0, 20, 0, 0},
{30, 25, 20, 0, 30, 60, 15},
{0, 5, 2, 0, 0, 0, 2}}

Definition at line 33 of file makeplanet.cc.

Referenced by Makesurface().

◆ rmax

const int rmax[][8]
static
Initial value:
= {{250, 325, 400, 0, 250, 0, 300},
{0, 300, 600, 0, 0, 0, 400},
{0, 300, 500, 0, 0, 0, 300},
{0, 0, 350, 0, 300, 0, 0},
{0, 0, 0, 60, 0, 0, 0},
{225, 0, 0, 0, 250, 0, 0},
{250, 0, 0, 0, 250, 200, 0},
{0, 200, 500, 0, 0, 0, 350}}

Definition at line 63 of file makeplanet.cc.

Referenced by Makesurface().

◆ rmin

const int rmin[][8]
static
Initial value:
= {{200, 225, 300, 0, 200, 0, 250},
{0, 250, 350, 0, 0, 0, 300},
{0, 225, 275, 0, 0, 0, 250},
{0, 0, 250, 0, 225, 0, 0},
{0, 0, 0, 30, 0, 0, 0},
{175, 0, 0, 0, 200, 0, 0},
{150, 0, 0, 0, 150, 150, 0},
{0, 200, 300, 0, 0, 0, 250}}

Definition at line 53 of file makeplanet.cc.

Referenced by Makesurface().

◆ x_chance

const int x_chance[] = {5, 15, 10, 4, 5, 7, 6}
static

Definition at line 32 of file makeplanet.cc.

Referenced by Makesurface().

◆ xmax

const int xmax[] = {23, 4, 8, 8, 32, 20, 20, 20}
static

Definition at line 24 of file makeplanet.cc.

Referenced by Makeplanet().

◆ xmin

const int xmin[] = {15, 2, 4, 4, 26, 12, 12, 12}
static

Definition at line 23 of file makeplanet.cc.

Referenced by Makeplanet().