00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include "orbit-place.hpp"
00042
00049 #ifndef _PLANET_HPP_
00050 #define _PLANET_HPP_
00051
00056 #define MAINPLANET "mainPlanet"
00057 #define SUBORDINATEPLANET "subordinatePlanet"
00058 #define GASGIANT "gasGiant"
00059 #define PLANETOIDBELT "planetoidBelt"
00060
00064 #define HEAVY_CORE 1
00065 #define MOLTEN_CORE 2
00066 #define ROCKY_BODY 3
00067 #define ICY_BODY 4
00068
00069
00070
00071 class planet: public orbitPlace
00072 {
00073 public:
00077 planet();
00078
00084 planet(char *s);
00085
00086
00092 void setDiameter(int d);
00093
00100 int getDiameter();
00101
00108 void setAtmosphere(int a);
00109
00116 int getAtmosphere();
00117
00124 void setHydrosphere(int h);
00125
00132 int getHydrosphere();
00133
00140 void setPopulation(int p);
00141
00147 int getPopulation();
00148
00155 void setGovernment(int g);
00156
00163 int getGovernment();
00164
00170 void setLawlevel(int l);
00171
00178 int getLawlevel();
00179
00185 void setTechlevel(int t);
00186
00192 int getTechlevel();
00193
00194
00201 void setNavalBase(int f);
00202
00209 int getNavalBase();
00210
00217 void setScoutBase(int f);
00218
00225 int getScoutBase();
00226
00232 void setSignature(char *s);
00233
00239 virtual char* getSignature();
00240
00244 virtual void genWBHData();
00245
00251 void setSizeModifier(int s);
00252
00256 int getSizeModifier();
00257
00263 void setPlanetDensityType(int d);
00264
00269 int getPlanetDensityType();
00270
00274 void determinePlanetDensityType();
00275
00281 void setPlanetDensity(double d);
00282
00286 double getPlanetDensity();
00287
00292 virtual void calculatePlanetDensity();
00293
00297 void calculatePlanetMass();
00298
00299
00300 protected:
00301
00302 private:
00303 union {
00304 struct {
00305 int diameter;
00306 int atmosphere;
00307 int hydrosphere;
00308 } s;
00309 int a[3];
00310 } physicalElements;
00311
00312 union {
00313 struct {
00314 int population;
00315 int government;
00316 int lawlevel;
00317 } s;
00318 int a[3];
00319 } peopleElements;
00320
00321 struct {
00322 int modifier;
00323 int density_type;
00324 double density;
00325 double mass;
00326 double gravity;
00327
00328 } size_details;
00329
00330 int techlevel;
00331 int scoutBase;
00332 int navalBase;
00333
00334 char* signature;
00335
00336 void setPhysicalElements();
00337
00338
00339 };
00340
00341 #endif // _PLANET_HPP_