Advanced Strategic Command
containerbasetype.h
Go to the documentation of this file.
1 /***************************************************************************
2  containerbasetype.h - description
3  -------------------
4  begin : Sun Feb 18 2001
5  copyright : (C) 2001 by Martin Bickel
6  email : bickel@asc-hq.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef containerbasetypeH
19  #define containerbasetypeH
20 
21  #include "objects.h"
22  #include "typen.h"
23  #include "research.h"
24  #include "mapitemtype.h"
25  #include "memsize_interface.h"
26 
28  protected:
29  std::bitset<64> features;
30  public:
32 
78 
79 
80  static const int functionNum = 45;
81 
82  bool hasFunction( ContainerFunctions function ) const;
83  bool hasAnyFunction( std::bitset<64> functions ) const;
84  static const char* getFunctionName( ContainerFunctions function );
85 
86  protected:
87  void setFunction( ContainerFunctions function );
88  public:
89 
90  int id;
91 
93  vector<int> secondaryIDs;
94 
95 
98 
101 
102  ASCString getName() const { return name; };
103  int getID() const { return id; };
104 
105 
108 
110  int jamming;
111 
113  int view;
114 
116  int height;
117  int getHeight() const { return height; };
118 
120  virtual ~ContainerBaseType() {};
121 
123  int maxLoadableUnits;
124 
127 
130 
133 
136 
140 
142  public:
143  TransportationIO ();
144  static const int entranceModeNum = 3;
145  enum { In = 1, Out = 2, Docking = 4 };
146  int mode;
147 
148  // int functionbits
149 
152 
155 
158 
161 
163 
165 
166  std::bitset<64> requiresUnitFeature;
167 
168  int movecost;
169 
171 
172  void runTextIO ( PropertyContainer& pc );
173  void read ( tnstream& stream ) ;
174  void write ( tnstream& stream ) const ;
175  };
176 
177  typedef vector<TransportationIO> EntranceSystems;
179 
181 
185 
186  void runTextIO ( PropertyContainer& pc );
187 
189  bool vehicleFit ( const VehicleType* type ) const ;
190 
196  int vehicleUnloadable ( const VehicleType* vehicleType, int carrierHeight ) const;
197 
198 
199  void read ( tnstream& stream ) ;
200  void write ( tnstream& stream ) const ;
201 
202 
203 
206 
209 
212 
215 
218 
222 
224 
227 
228  virtual int getMoveMalusType() const = 0;
229 
233  Resources getStorageCapacity( int mode ) const;
234  protected:
237 
238  public:
239 
241 
242  struct {
243  int range;
244 
246 
248  vector<IntRange> objectsHarvestable;
249 
251  vector<IntRange> objectGroupsHarvestable;
252  } autoHarvest;
253 
254  };
255 
256 #endif
ASCString infoImageSmallFilename
A mathematical matrix for transforming Resources instance (which is mathematically a vector) into a d...
Definition: typen.h:158
static const char * getFunctionName(ContainerFunctions function)
int defaultMaxResearchpoints
when a building of this type is placed on a map, its maxResearch property will be set to this value ...
int maxLoadableUnits
the maximum number of units that can be loaded
virtual int getMoveMalusType() const =0
void write(tnstream &stream) const
TechAdapterDependency techDependency
vector< IntRange > objectGroupsHarvestable
the group-ids of objects this unit can construct
ResourceMatrix productionEfficiency
void runTextIO(PropertyContainer &pc)
registers the properties of this item for loading/writing into asctxt files
bool hasFunction(ContainerFunctions function) const
vector< int > secondaryIDs
when loading a file and these IDs are encountered, this object will be used.
struct ContainerBaseType::@5 autoHarvest
bool vehicleFit(const VehicleType *type) const
can units of the given type be moved into this buildtype? This is a prerequisite - but not the only r...
static const int functionNum
The interface for all kinds of IO stream.
void runTextIO(PropertyContainer &pc)
vector< IntRange > objectsHarvestable
the ids of objects this unit can construct
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
ASCString description
short description of the units role, for example "strategic bomber"
int vehicleCategoriesStorable
bitmapped: vehicle categories that can be stored the container
vector< IntRange > vehiclesInternallyProduceable
the default production capabilities of this container.
int view
the visibility range
int maxLoadableUnitSize
the maximum size of a unit that may enter the building
void setFunction(ContainerFunctions function)
The class describing properties that are common to all vehicles of a certain kind.
Definition: vehicletype.h:177
vector< TransportationIO > EntranceSystems
int vehicleCategoriesProduceable
bitmapped: vehicle categories that can be produced in the container
The base class for everything that can be placed on a map field.
Definition: mapitemtype.h:16
int height_rel
a height of a loadable unit have this height relative to the container; -100 if not used ...
int vehicleUnloadable(const VehicleType *vehicleType, int carrierHeight) const
checks the unloading of a unit type
bool hasAnyFunction(std::bitset< 64 > functions) const
An abstract base class that provides the interface for all kinds of items that ASC loads from disk...
Definition: typen.h:287
std::bitset< 64 > features
int jamming
the radar jamming power
ASCString infoImageFilename
the filename of an image that is shown in info dialogs
EntranceSystems entranceSystems
int efficiencymaterial
currently only used by mining stations: the efficiency of the resource extraction from the ground...
int vehicleCategoriesLoadable
bitmapped: vehicle categories that may enter the container
Resources getStorageCapacity(int mode) const
returns the Storage capacity of the unit
int height
the levels of height which this unit can enter
int nominalresearchpoints
the number of reseach points for which the plus settings apllies
Mine and Objects which can be placed on a map field.
int height_abs
a loadable unit must be on this level of height; 0 if not used
ASCString getName() const
int maxresearchpoints
the maximum number of research points a research center may produce
ASCString infotext
an extensive information about the unit/building which may be several paragraphs long ...
Resources are basically the currency of ASC.
Definition: typen.h:97
int minFieldRepairDamage
if the unit is repaired in the field (that is, not inside a transport or building), it can only be repaired up to this level 0 would result in a complete repair being possible, 20 that it can only be restored to 20% damage (80% health).
int maxLoadableWeight
the maximum total weight of all loaded units
Everything related to research.
Resources defaultProduction
if a new building is constructed, this will be the resource production of the building ...
int getHeight() const
ASCString name
a short name, for example B-52
void write(tnstream &stream) const
write the binary representation of this item to the given stream
void read(tnstream &stream)
read the binary representation of this item from the given stream
virtual ~ContainerBaseType()
int container_height
the container must be on this height
int efficiencyfuel
currently only used by mining stations: the efficiency of the resource extraction from the ground...