00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef containerbasetypeH
00019 #define containerbasetypeH
00020
00021 #include "objects.h"
00022 #include "typen.h"
00023 #include "research.h"
00024 #include "mapitemtype.h"
00025 #include "memsize_interface.h"
00026
00027 class ContainerBaseType: public MapItemType, public LoadableItemType, public MemorySizeQueryInterface {
00028 protected:
00029 std::bitset<64> features;
00030 public:
00031 ContainerBaseType ();
00032
00033 enum ContainerFunctions { TrainingCenter,
00034 InternalVehicleProduction,
00035 AmmoProduction,
00036 InternalUnitRepair,
00037 RecycleUnits,
00038 Research,
00039 Sonar,
00040 SatelliteView,
00041 MineView,
00042 WindPowerPlant,
00043 SolarPowerPlant,
00044 MatterConverter,
00045 MiningStation,
00046 ProduceNonLeavableUnits,
00047 ResourceSink,
00048 ExternalEnergyTransfer,
00049 ExternalMaterialTransfer,
00050 ExternalFuelTransfer,
00051 ExternalAmmoTransfer,
00052 ExternalRepair,
00053 NoObjectChaining,
00054 SelfDestructOnConquer,
00055 Paratrooper,
00056 PlaceMines,
00057 CruiserLanding,
00058 ConquerBuildings,
00059 MoveAfterAttack,
00060 ExternalVehicleProduction,
00061 ConstructBuildings,
00062 IceBreaker,
00063 NoInairRefuelling,
00064 MakesTracks,
00065 DetectsMineralResources,
00066 NoReactionfire,
00067 AutoRepair,
00068 KamikazeOnly,
00069 ImmuneToMines,
00070 JamsOnlyOwnField,
00071 MoveWithReactionFire,
00072 OnlyMoveToAndFromTransports,
00073 AutoHarvestObjects,
00074 NoProductionCustomization,
00075 ManualSelfDestruct};
00076
00077
00078 static const int functionNum = 43;
00079
00080 bool hasFunction( ContainerFunctions function ) const;
00081 bool hasAnyFunction( std::bitset<64> functions ) const;
00082 static const char* getFunctionName( ContainerFunctions function );
00083
00084 protected:
00085 void setFunction( ContainerFunctions function );
00086 public:
00087
00088 int id;
00089
00091 vector<int> secondaryIDs;
00092
00093
00095 ASCString name;
00096
00097 ASCString getName() const { return name; };
00098 int getID() const { return id; };
00099
00100
00102 ASCString infotext;
00103
00105 int jamming;
00106
00108 int view;
00109
00110
00111 Resources productionCost;
00112 virtual ~ContainerBaseType() {};
00113
00115 int maxLoadableUnits;
00116
00118 int maxLoadableUnitSize;
00119
00121 int maxLoadableWeight;
00122
00124 int vehicleCategoriesStorable;
00125
00127 int vehicleCategoriesProduceable;
00128
00131 vector<IntRange> vehiclesInternallyProduceable;
00132
00133 class TransportationIO {
00134 public:
00135 TransportationIO ();
00136 static const int entranceModeNum = 3;
00137 enum { In = 1, Out = 2, Docking = 4 };
00138 int mode;
00139
00140
00141
00143 int height_abs;
00144
00146 int height_rel;
00147
00149 int container_height;
00150
00152 int vehicleCategoriesLoadable;
00153
00154 int dockingHeight_abs;
00155
00156 int dockingHeight_rel;
00157
00158 std::bitset<64> requiresUnitFeature;
00159
00160 int movecost;
00161
00162 bool disableAttack;
00163
00164 void runTextIO ( PropertyContainer& pc );
00165 void read ( tnstream& stream ) ;
00166 void write ( tnstream& stream ) const ;
00167 };
00168
00169 typedef vector<TransportationIO> EntranceSystems;
00170 EntranceSystems entranceSystems;
00171
00172 TechAdapterDependency techDependency;
00173
00175 ASCString infoImageFilename;
00176
00177 void runTextIO ( PropertyContainer& pc );
00178
00180 bool vehicleFit ( const Vehicletype* type ) const ;
00181
00182 void read ( tnstream& stream ) ;
00183 void write ( tnstream& stream ) const ;
00184
00185
00186
00188 int efficiencyfuel;
00189
00191 int efficiencymaterial;
00192
00194 int maxresearchpoints;
00195
00197 int defaultMaxResearchpoints;
00198
00200 int nominalresearchpoints;
00201
00202 Resources maxplus;
00203
00205 Resources defaultProduction;
00206
00207 virtual int getMoveMalusType() const = 0;
00208
00212 Resources getStorageCapacity( int mode ) const;
00213 protected:
00214 Resources asc_mode_tank;
00215 Resources bi_mode_tank;
00216
00217 public:
00218
00219 ResourceMatrix productionEfficiency;
00220
00221 struct {
00222 int range;
00223
00224 int maxFieldsPerTurn;
00225
00227 vector<IntRange> objectsHarvestable;
00228
00230 vector<IntRange> objectGroupsHarvestable;
00231 } autoHarvest;
00232
00233 };
00234
00235 #endif