Definition at line 71 of file planet.hpp.
Public Member Functions | |
planet () | |
planet (char *s) | |
void | setDiameter (int d) |
int | getDiameter () |
void | setAtmosphere (int a) |
int | getAtmosphere () |
void | setHydrosphere (int h) |
int | getHydrosphere () |
void | setPopulation (int p) |
int | getPopulation () |
void | setGovernment (int g) |
int | getGovernment () |
void | setLawlevel (int l) |
int | getLawlevel () |
void | setTechlevel (int t) |
int | getTechlevel () |
void | setNavalBase (int f) |
int | getNavalBase () |
void | setScoutBase (int f) |
int | getScoutBase () |
void | setSignature (char *s) |
virtual char * | getSignature () |
virtual void | genWBHData () |
void | setSizeModifier (int s) |
int | getSizeModifier () |
void | setPlanetDensityType (int d) |
int | getPlanetDensityType () |
void | determinePlanetDensityType () |
void | setPlanetDensity (double d) |
double | getPlanetDensity () |
virtual void | calculatePlanetDensity () |
void | calculatePlanetMass () |
planet::planet | ( | ) |
Class constructor.
Definition at line 78 of file planet.cpp.
References setSignature().
00078 :orbitPlace(){ 00079 this->setPhysicalElements(); 00080 this->setSignature("planet"); 00081 }
Here is the call graph for this function:
planet::planet | ( | char * | s | ) |
Full class construtor
s | pointer to array of char with will be the signature of the object. |
Definition at line 83 of file planet.cpp.
References setSignature().
00083 : orbitPlace(){ 00084 this->setSignature(s); 00085 this->setPhysicalElements(); 00086 }
Here is the call graph for this function:
void planet::calculatePlanetDensity | ( | ) | [virtual] |
Calculate the planet density using the planet density type Note: this gets overloaded in the gasGiant object.
Definition at line 277 of file planet.cpp.
References setPlanetDensity().
00277 { 00278 if ( density_table_initialized == 0 ) 00279 initializeDensityTable (); 00280 int rx = d2d6() + d1d6() - 3; 00281 this->setPlanetDensity(density_table[rx][this->getPlanetDensityType()-1]); 00282 00283 00284 }
Here is the call graph for this function:
void planet::calculatePlanetMass | ( | ) |
Calculate the planetary mass
Definition at line 286 of file planet.cpp.
References getDiameter(), and getPlanetDensity().
00286 { 00287 double mass; 00288 00289 mass = ( ( this->getDiameter() == 0 ? 0.8 : (double) this->getDiameter()) / 8 ) ; 00290 mass = mass * mass * mass; 00291 mass = this->getPlanetDensity() * mass; 00292 00293 size_details.mass = mass; 00294 00295 }
Here is the call graph for this function:
void planet::determinePlanetDensityType | ( | ) |
Determine the planet density type
Definition at line 193 of file planet.cpp.
References setPlanetDensityType().
Referenced by mainPlanet::genWBHData().
00193 { 00194 int dm=0; 00195 00196 if ( this->getDiameter() < 5 ) dm = 1; 00197 if ( this->getDiameter() > 5) dm = dm-2; 00198 00199 if ( this->getAtmosphere() < 4 ) dm = dm+1; 00200 if ( this->getAtmosphere() > 5 ) dm = dm-2; 00201 00202 switch(d2d6()){ 00203 case 1: 00204 this->setPlanetDensityType(HEAVY_CORE); 00205 break; 00206 case 2: 00207 case 3: 00208 case 4: 00209 case 5: 00210 case 6: 00211 case 7: 00212 case 8: 00213 case 9: 00214 case 10: 00215 this->setPlanetDensityType(MOLTEN_CORE); 00216 break; 00217 case 11: 00218 case 12: 00219 case 13: 00220 case 14: 00221 this->setPlanetDensityType(ROCKY_BODY); 00222 break; 00223 default: 00224 this->setPlanetDensityType(ICY_BODY); 00225 break; 00226 }; 00227 }
Here is the call graph for this function:
Here is the caller graph for this function:
void planet::genWBHData | ( | ) | [virtual] |
Generate World Builder's Handbook info about this planet
Reimplemented in mainPlanet.
Definition at line 172 of file planet.cpp.
int planet::getAtmosphere | ( | ) |
Get our atmosphere
Definition at line 101 of file planet.cpp.
int planet::getDiameter | ( | ) |
Get our diameter
Definition at line 93 of file planet.cpp.
Referenced by calculatePlanetMass().
Here is the caller graph for this function:
int planet::getGovernment | ( | ) |
Get our governement
Definition at line 125 of file planet.cpp.
Referenced by mainPlanet::asText().
Here is the caller graph for this function:
int planet::getHydrosphere | ( | ) |
Get our hydrosphere
Definition at line 109 of file planet.cpp.
Referenced by mainPlanet::asText().
Here is the caller graph for this function:
int planet::getLawlevel | ( | ) |
get the lawlevel attr
Definition at line 130 of file planet.cpp.
int planet::getNavalBase | ( | ) |
Get the navalBase flag
Definition at line 160 of file planet.cpp.
double planet::getPlanetDensity | ( | ) |
get the actual planetary density
Definition at line 234 of file planet.cpp.
Referenced by calculatePlanetMass().
Here is the caller graph for this function:
int planet::getPlanetDensityType | ( | ) |
int planet::getPopulation | ( | ) |
get our population
Definition at line 117 of file planet.cpp.
Referenced by mainPlanet::asText().
Here is the caller graph for this function:
int planet::getScoutBase | ( | ) |
Get the scoutBase flag
return 1 if scout base is present 0 if not
Definition at line 152 of file planet.cpp.
char * planet::getSignature | ( | ) | [virtual] |
Retrieve the signature
Definition at line 168 of file planet.cpp.
int planet::getSizeModifier | ( | ) |
int planet::getTechlevel | ( | ) |
get the techlevel attr
Definition at line 144 of file planet.cpp.
void planet::setAtmosphere | ( | int | a | ) |
Set our atmosphere
a | integer value to set the atmosphere to |
Definition at line 97 of file planet.cpp.
void planet::setDiameter | ( | int | d | ) |
Set our diameter
d | integer value of the diameter. |
Definition at line 89 of file planet.cpp.
void planet::setGovernment | ( | int | g | ) |
set our governement
g | integer value to set the governement type to |
Definition at line 121 of file planet.cpp.
Referenced by mainPlanet::mainPlanet().
Here is the caller graph for this function:
void planet::setHydrosphere | ( | int | h | ) |
Set our Hydrosphere
h | integer value for the hydrosphere |
Definition at line 105 of file planet.cpp.
void planet::setLawlevel | ( | int | l | ) |
Set the lawlevel attr
l | integer value to set the lawlevel to |
Definition at line 134 of file planet.cpp.
Referenced by mainPlanet::mainPlanet().
Here is the caller graph for this function:
void planet::setNavalBase | ( | int | f | ) |
Set flag for navalBase attr
f | integer flag to set for naval base |
Definition at line 156 of file planet.cpp.
Referenced by mainPlanet::mainPlanet().
Here is the caller graph for this function:
void planet::setPlanetDensity | ( | double | d | ) |
set the actual planetary density
d | double value for the planetary density |
Definition at line 229 of file planet.cpp.
Referenced by calculatePlanetDensity().
Here is the caller graph for this function:
void planet::setPlanetDensityType | ( | int | d | ) |
Set the WBH Planet Density Type
d | integer value to set the density type to |
Definition at line 185 of file planet.cpp.
Referenced by determinePlanetDensityType().
Here is the caller graph for this function:
void planet::setPopulation | ( | int | p | ) |
Set our population
p | integer value to set the population to |
Definition at line 113 of file planet.cpp.
Referenced by mainPlanet::mainPlanet().
Here is the caller graph for this function:
void planet::setScoutBase | ( | int | f | ) |
Set flag for scoutBase attr
f | integer flag to set for a scout base |
Definition at line 148 of file planet.cpp.
Referenced by mainPlanet::mainPlanet().
Here is the caller graph for this function:
void planet::setSignature | ( | char * | s | ) |
Set the object's ascii signature
s | pointer to array of char containing ascii signature. |
Definition at line 164 of file planet.cpp.
Referenced by planet().
Here is the caller graph for this function:
void planet::setSizeModifier | ( | int | s | ) |
Set the WBH size detail of the size modifier
s | integer value to set the size modifier to |
Definition at line 175 of file planet.cpp.
Referenced by mainPlanet::genWBHData().
Here is the caller graph for this function:
void planet::setTechlevel | ( | int | t | ) |
set the techlevel attr
t | integer value to set the techlevel attr to. |
Definition at line 138 of file planet.cpp.