4
(c) Richard Thrippleton
5
Licensing terms are in the 'LICENSE' file
6
If that file is not included with this source then permission is not given to use this source in any way whatsoever.
16
class planet //Planet object
19
const static int ISIZE=256; //Count of available planets in the index
20
enum {STAR=0,INHABITED=1,UNINHABITED=2}; //Planetary object types
22
planet(char* nam,cord put,int typ,alliance* all); //Spawn a new planet
23
~planet(); //Destructor, resolves dependencies
25
static void init(); //Initialise datastructures for the planet module
26
static void purgeall(); //Cleans up and purges planet data, used after a game
27
static planet* get(int indx); //Return the planet of given index
28
static planet* pick(alliance* tali); //Pick a random planet of given alliance
29
static planet* pickally(alliance* tali); //Pick a random planet allied to given alliance
30
static planet* pickhostile(alliance* tali); //Pick a random planet hostile to given alliance
31
static bool masslock(cord loc); //Return whether or not given location is mass-locked by planets
32
static void saveall(); //Save all the planets to the database
33
static void loadall(); //Load all the planets from the database
34
static void generatename(char* put); //Generate a planetary name, put it in put
35
static void shipyards(); //Randomly spawn ships
37
int interact(char* txt,short cmod,short opr,ship* mshp); //Handles a server request for information/action from this planet, with the given comm mode, operand and player's ship, writing the text into txt and returning the sprite index (-1 if n/a)
38
void netout(int typ,unsigned char* buf); //Get type of data from planet into a network buffer
40
int self; //Self index
41
int spr; //Sprite to display for this
43
alliance* all; //Alliance
44
int typ; //Planet type 1:Sun 2:Uninhabited 3:Inhabited
47
planet(int self); //Constructor, given self index loads the planet from the database
49
void save(); //Save this planet to the database
50
void load(); //Load this planet from the database
51
void shipyard(); //Spawn a ship from the library at this planet
53
static planet* planets[ISIZE]; //Planets in the index
56
int rot; //Version of sprite to use
57
equip* sold[8]; //Sold equipment