Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List

RacialTrait.h

Go to the documentation of this file.
00001 /*
00002 Copyright 2003 - 2005 Elliott Kleinrock, Dan Neely, Kurt W. Over, Damon Domjan
00003 
00004 This file is part of FreeStars, a free clone of the Stars! game.
00005 
00006 FreeStars is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2 of the License, or
00009 (at your option) any later version.
00010 
00011 FreeStars is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with FreeStars; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 The full GPL Copyright notice should be in the file COPYING.txt
00021 
00022 Contact:
00023 Email Elliott at 9jm0tjj02@sneakemail.com
00024 */
00025 
00030 #if !defined(RacialTrait_h)
00031 #define RacialTrait_h
00032 
00033 #include <string>
00034 #include <deque>
00035 using namespace std;
00036 
00037 class TiXmlNode;
00038 class Player;
00039 class Hull;
00040 
00041 #include "FSTypes.h"
00042 #include "Component.h"
00043 
00050 class RacialTrait {
00051 public:
00052         RacialTrait();
00053         virtual ~RacialTrait();
00054         static RacialTrait * ParseNode(const TiXmlNode * node);
00055 
00056         string Name() const                                                     { return mName; }
00057         double GroundAttackFactor() const                       { return mGroundAttackFactor; }
00058         double GroundDefenseFactor() const                      { return mGroundDefenseFactor; }
00059         double GrowthRateFactor() const                         { return mGrowthRateFactor; }
00060         double PopulationFactor() const                         { return mPopulationFactor; }
00061         HullType InherentCloakHull() const                      { return mInherentCloakHull; }
00062         long InherentCloakAmount() const                        { return mInherentCloakAmount; }
00063         bool CloakCargo() const                                         { return mCloakCargo; }
00064         long MineSpeedBonus() const                                     { return mMineSpeedBonus; }
00065         double SpyTechBonus() const                                     { return mSpyTechBonus; }
00066         double BattleSpeedBonus() const                         { return mBattleSpeedBonus; }
00067         double ComponentCostFactor(ComponentType ct) const;
00068         double PermaformChance() const                          { return mPermaformChance; }
00069         bool CanSeeHabSettings() const                          { return mCanSeeHabSettings; }
00070         bool TemporaryTerraform() const                         { return mTemporaryTerraform; }
00071         bool ScanDesign() const                                         { return mScanDesign; }
00072         double RepairFactor() const                                     { return mRepairFactor; }
00073         double FreighterReproduction() const            { return mFreighterReproduction; }
00074         bool MineFieldScanning() const                          { return mMineFieldScanning; }
00075         bool CanRemoteDetonate() const                          { return mCanRemoteDetonate; }
00076         double MineDecayFactor() const                          { return mMineDecayFactor; }
00077 
00078         bool PacketTerraform() const                            { return mPacketTerraform; }
00079         bool PacketScanning() const                                     { return mPacketScanning; }
00080         double PacketCostMinFactor() const                      { return mPacketCostMinFactor; }
00081         long PacketSizeOneMin() const                           { return mPacketSizeOneMin; }
00082         long PacketSizeMixed() const                            { return mPacketSizeMixed; }
00083         long PacketCostResources() const                        { return mPacketCostResources; }
00084         double PacketDecayFactor() const                        { return mPacketDecayFactor; }
00085         double PacketCatchFactor() const                        { return mPacketCatchFactor; }
00086         long PacketDecayPenalty() const                         { return mPacketDecayPenalty; }
00087 
00088         long StartingTech(TechType tt) const            { return mStartingTech[tt]; }
00089         long StartAtBonus() const                                       { return mStartAtBonus; }
00090         bool HasSecondPlanet() const                            { return mSecondPlanet; }
00091         bool GateCargo() const                                          { return mGateCargo; }
00092         double OvergateLossFactor() const                       { return mOvergateLossFactor; }
00093         bool GateScanning() const                                       { return mGateScanning; }
00094         long ARTechType() const                                         { return mARTechType; }
00095         double FuelFactor() const                                       { return mFuelFactor; }
00096         bool GeneralResearch() const                            { return mGeneralResearch; }
00097         bool UltimateRecycle() const                            { return mUltimateRecycle; }
00098         double EngineFailure(long speed) const          { return (speed > mEngineFailureSpeed) ? mEngineFailureRate : 0.0; }
00099         double SpaceScanFactor() const                          { return mSpaceScanFactor; }
00100         double PenScanFactor() const                            { return mPenScanFactor; }
00101         double StartingPopFactor() const                        { return mStartingPopFactor; }
00102         double MaxMiniturize() const                            { return mMaxMiniturize; }
00103         double MiniturizeRate() const                           { return mMiniturizeRate; }
00104         double ZeroTechCost() const                                     { return mZeroTechCost; }
00105         double ShieldFactor() const                                     { return mShieldFactor; }
00106         double ArmorFactor() const                                      { return mArmorFactor; }
00107         double ShieldRegenRate() const                          { return mShieldRegenRate; }
00108 
00109         double DefenseFactor() const                            { return mDefenseFactor; }
00110 
00111         void ParseStartShips(const TiXmlNode * node);
00112         long StartShipCount() const                                     { return mShipDesigns.size(); }
00113         const Ship * GetStartDesign(long i) const       { return mShipDesigns[i]; }
00114         long GetStartCount(long i) const                        { return mShipCounts[i]; }
00115         long GetStart2ndCount(long i) const                     { return mShip2ndCounts[i]; }
00116 
00117         // Builtin scanning -- JOAT and AR in base rules
00118         long BuiltinScan(const Player * player, HullType hc, bool PenScan, long pop = 0) const;
00119 
00120 private:
00121         string mName;
00122         double mGroundAttackFactor;
00123         double mGroundDefenseFactor;
00124         double mGrowthRateFactor;
00125         double mPopulationFactor;
00126         HullType mInherentCloakHull;
00127         long mInherentCloakAmount;
00128         bool mCloakCargo;
00129         long mMineSpeedBonus;
00130         double mSpyTechBonus;
00131         double mBattleSpeedBonus;
00132         deque<ComponentType> mComponentCostType;
00133         deque<double> mComponentCostFactor;
00134         double mPermaformChance;
00135         bool mCanSeeHabSettings;
00136         bool mTemporaryTerraform;
00137         bool mScanDesign;
00138         double mRepairFactor;
00139         double mFreighterReproduction;
00140         bool mMineFieldScanning;
00141         bool mCanRemoteDetonate;
00142         double mMineDecayFactor;
00143 
00144         bool mPacketTerraform;
00145         bool mPacketScanning;
00146         double mPacketCostMinFactor;
00147         long mPacketSizeOneMin;
00148         long mPacketSizeMixed;
00149         long mPacketCostResources;
00150         double mPacketDecayFactor;
00151         double mPacketCatchFactor;
00152         long mPacketDecayPenalty;
00153 
00154         deque<long> mStartingTech;
00155         long mStartAtBonus;
00156         bool mSecondPlanet;
00157         bool mGateCargo;
00158         double mOvergateLossFactor;
00159         bool mGateScanning;
00160         long mARTechType;
00161         double mFuelFactor;
00162         bool mGeneralResearch;
00163         bool mUltimateRecycle;
00164         long mEngineFailureSpeed;
00165         double mEngineFailureRate;
00166         double mSpaceScanFactor;
00167         double mPenScanFactor;
00168         double mStartingPopFactor;
00169         double mMaxMiniturize;
00170         double mMiniturizeRate;
00171         double mZeroTechCost;
00172         double mShieldFactor;
00173         double mArmorFactor;
00174         double mShieldRegenRate;
00175 
00176         double mDefenseFactor;
00177 
00178         HullType mBISHull;
00179         HullType mBISHullPen;
00180         TechType mBISTech;
00181         long mBISMultiplier;
00182         bool mBISCheckPenFactor;
00183         double mBISPopFactor;
00184 
00185         deque<Ship *> mShipDesigns;
00186         deque<long> mShipCounts;
00187         deque<long> mShip2ndCounts;
00188 };
00189 
00190 #endif // !defined(RacialTrait_h)

Generated on Mon Aug 8 21:33:45 2005 for Freestars by  doxygen 1.4.2-20050421