include/planet.hpp

00001 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
00002 /*
00003  * frpuniverse
00004  * Copyright (C) Peter L. Berghold 2008 <Peter@Berghold.net>
00005  * 
00006  * frpuniverse is free software.
00007  * 
00008  * You may redistribute it and/or modify it under the terms of the
00009  * GNU General Public License, as published by the Free Software
00010  * Foundation; either version 2 of the License, or (at your option)
00011  * any later version.
00012  * 
00013  * frpuniverse is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with frpuniverse.  If not, write to:
00020  *      The Free Software Foundation, Inc.,
00021  *      51 Franklin Street, Fifth Floor
00022  *      Boston, MA  02110-1301, USA.
00023  *
00024  * $Id: planet.hpp,v 1.2 2008/02/27 03:48:39 plankowner Exp $
00025  * 
00026  * $Log: planet.hpp,v $
00027  * Revision 1.2  2008/02/27 03:48:39  plankowner
00028  * Starting to put "World Builders Handbook" stuff into the modules.
00029  *
00030  * Revision 1.1  2008/02/19 19:31:19  plankowner
00031  * Reorganized the source files and headers for this project
00032  *
00033  * Changed the personObj attribute "constitution" to "endurance" (DOH!)
00034  * since endurance is the Traveller gaming system not the D&D system. :-)
00035  *
00036  * Revision 1.3  2008/02/12 22:10:51  plankowner
00037  * Started fleshing more things out a bit.
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_

Generated on Fri Mar 7 16:40:53 2008 for frpuniverse by  doxygen 1.4.7