include/star.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 
00025 #include "orbit-place.hpp"
00026 #include "orbit-plane.hpp"
00027 
00028 #ifndef _STAR_HPP_
00029 #define _STAR_HPP_
00030 
00031 
00032 #define STAR_TYPE_O  0
00033 #define STAR_TYPE_B  1
00034 #define STAR_TYPE_A  2
00035 #define STAR_TYPE_F  3
00036 #define STAR_TYPE_G  4
00037 #define STAR_TYPE_K  5
00038 #define STAR_TYPE_M  6
00039 
00040 #define STAR_SIZE_Ia    0
00041 #define STAR_SIZE_Ib    1
00042 #define STAR_SIZE_II    2
00043 #define STAR_SIZE_III   3
00044 #define STAR_SIZE_IV    4
00045 #define STAR_SIZE_V             5
00046 #define STAR_SIZE_VI    6
00047 #define STAR_SIZE_D             7
00048 
00049 #define STARXMLTAG      "star"
00050 
00066 class star: public orbitPlace 
00067 {
00068 public:
00073         star();
00074         
00083         star(star* s);
00084         
00085         
00092         void setOrbit(int ix){
00093                 this->setIndex(ix);
00094         }
00095         
00102         int getOrbit() {
00103                 return this->getIndex();
00104         };
00105         
00106         
00110         void generateStarInfo();
00111         
00116         void generateStarInfo(star*);
00117         
00122         char* toXML();
00123         
00132         void setSize(int s){ size=s; };
00133         
00142         int  getSize(){ return size; };
00143         
00151         void setType(int t){ type=t; };
00152         
00160         int  getType(){ return type; };
00161         
00172         void setSpectralClass(int c){ spectral=c; };
00173         
00179         int  getSpectralClass(){ return spectral; }; 
00180         
00189         void setMinOrbitNumber(int m){ min_orbit_number  = m; };
00190         
00197         int  getMinOrbitNumber(){ return min_orbit_number; };
00198         
00210         void setHabitableOrbit(int h){ habitable_orbit=h; };
00211         
00220         int  getHabitableorbit(){ return habitable_orbit; };
00221         
00228         void setMaxOrbits(int m) { max_orbits=m; } ;
00229         
00236         int   getMaxOrbits(){ return max_orbits; };
00237         
00244         void setGasGiants(int g) { gas_giants=g;};
00245         
00252         int  getGasGiants(){ return gas_giants; };
00253         
00260         void setPlanetoid(int p) { planetoid=p; };
00261         
00268         int  getPlanetoid(){ return planetoid; };
00269         
00276         void placeCompanion(star* s,int x);
00277         
00285         int  hasCloseCompanion();
00286         
00292         void setOrbits(orbitPlane*);
00293         
00299         orbitPlane* getOrbits();
00300         
00307         char* nodeSignature();
00308 protected:
00309 
00310 private:
00311         int  size; 
00312         int  type; 
00313         int  spectral; 
00314         int  min_orbit_number; 
00315         int  habitable_orbit; 
00316         int  max_orbits;
00317         int  gas_giants;
00318         int  planetoid;
00319         int  size_roll;  // these get applied as DMs for subordinate (companion) stars
00320         int  type_roll;  //  <---------------------------------------------
00321         
00322         int  closeCompanionPresent;
00323         star *closeCompanion;
00324         
00325         int calculateMinOrbit();
00326         int calculateHabitableOrbit();
00327         
00328         orbitPlane* orbits;
00329         
00330 };
00331 
00332 #endif // _STAR_HPP_

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