28 #include <SDL_types.h>
137 static const char*
name(
int r );
216 fatalError (
" MapCoordinate::read - data was written by MapCoordinate3D ");
221 bool valid()
const {
return x >= 0 &&
y >= 0 ; } ;
222 void move(
int width,
int height);
250 void setnum (
int _x,
int _y,
int numericalz ) {
x = _x;
y = _y; z = numericalz; };
274 std::map<ASCString, ASCString> data;
313 template<
typename T>
317 for (
typename vector<T>::iterator i = vector<T>::begin(); i != vector<T>::end(); ++i )
323 template<
typename T,
typename U>
327 for (
typename std::map<T,U>::iterator i = std::map<T,U>::begin(); i != std::map<T,U>::end(); ++i )
410 #define chtiefgetaucht 1
412 #define chschwimmend 4
414 #define chtieffliegend 16
415 #define chfliegend 32
416 #define chhochfliegend 64
417 #define chsatellit 128
431 #define fieldxsize 48
432 #define fieldysize 48
433 #define fielddistx 64
434 #define fielddisty 24
435 #define fielddisthalfx 32
440 #define fieldsizex fieldxsize
441 #define fieldsizey fieldysize
455 #define maxint numeric_limits<int>::max()
456 #define minint numeric_limits<int>::min()
458 #define maxfloat numeric_limits<float>::max()
459 #define minfloat numeric_limits<float>::min()
462 #define maxint INT_MAX
463 #define minint INT_MIN
465 #define maxfloat FLT_MAX
466 #define minfloat FLT_MIN
509 #define cnet_storeenergy 0x001 // es wird garantiert, dass material immer das 2 und fuel das 4 fache von energy ist
510 #define cnet_storematerial 0x002
511 #define cnet_storefuel 0x004
513 #define cnet_moveenergyout 0x008
514 #define cnet_movematerialout 0x010
515 #define cnet_movefuelout 0x020
517 #define cnet_stopenergyinput 0x040
518 #define cnet_stopmaterialinput 0x080
519 #define cnet_stopfuelinput 0x100
521 #define cnet_stopenergyoutput 0x200
522 #define cnet_stopmaterialoutput 0x400
523 #define cnet_stopfueloutput 0x800
533 #define destruct_building_fuel_usage 10 // beim Abreissen wird 10 * fuelconsumption Fuel fuelconsumptiont
536 #define dissectunitresearchpointsplus 2 // Beim dissectn einer vehicle wird der sovielte Teil der Researchpoints jeder unbekannten Technologie gutgeschrieben
538 #define dissectunitresearchpointsplus2 3 // Beim dissectn einer vehicle wird der sovielte Teil der Researchpoints jeder unbekannten Technologie gutgeschrieben.
the time in ASC, measured in turns and moves
const double productionLineConstructionCostFactor
A mathematical matrix for transforming Resources instance (which is mathematically a vector) into a d...
Resources(int e, int m, int f)
ASCString filename
The name of the file from which the item was loaded.
const int cnetcontrolnum
The number of netcontrol actions ; see cnetcontrol.
const char * cwettertypen[cwettertypennum]
the names of the different weather
const int cmm_building
The movemalus type for a building. It is used for SingleWeapon::targetingAccuracy ...
void write(tnstream &stream) const
virtual void write(tnstream &stream) const =0
write the binary representation of this item to the given stream
const int directionangle[sidenum]
virtual void writeInt(int i)
Writes a 32 bit signed Integer. In the stream little-endian byte order is used and a translation is p...
void read(tnstream &stream)
bool operator<(const MapCoordinate &mc) const
const int choehenstufennum
The number of levels of height.
const int waffenanzahl
The number of different weapon types.
ASCString toString(bool coordinates=false) const
void runTextIO(const ASCString &name, PropertyContainer &pc)
bool operator<(const Resources &res)
virtual int readInt(void)
Reads a 32 bit signed Integer. In the stream little-endian byte order is used and a translation is pe...
void write(tnstream &stream) const
void read(tnstream &stream)
int getFirstBit(int zahl)
Count the number of zero bits on the LSB side of "zahl".
ASCString toString() const
const char * resourceNames[3]
the names of the different resources. Redundent, as we already have Resources::name ...
static const int materialColor
const char * cmovemalitypes[cmovemalitypenum]
the names of the different MoveMalusTypes
Resources & operator-=(const Resources &res)
VisibilityStates
the different states that a player's view on a field can have
virtual void runTextIO(PropertyContainer &pc)=0
registers the properties of this item for loading/writing into asctxt files
void runTextIO(PropertyContainer &pc)
const int recyclingoutput
the percentage of a units production cost that is reclaimed when the unit is recycled ...
int getNumericalHeight() const
void read(tnstream &stream)
const int & resource(int type) const
const int mine_movemalus_increase
every mine on a field increases the field's movemalus by this amount (percent)
void read(tnstream &stream)
ASCString toString(bool coordinates=false) const
Global platform dependant definitions. This file just branches to the platform specific files in thei...
The interface for all kinds of IO stream.
void write(tnstream &stream) const
static const char * name(int r)
vector< IntRange > String2IntRangeVector(const ASCString &t)
parses a string repesenting a number of int ranges Example input: "10-20; 25 ; 30-125" ...
const double productionLineRemovalCostFactor
The ASCString class provides an abstract way to manipulate strings.
void read(tnstream &stream)
int from
the lower boundary.
const char * cnetcontrol[cnetcontrolnum]
The actions that can be used to control a ResourceNet.
void setNumericalHeight(int nh)
const int mineputmovedecrease
the movement cost for putting mines on the map
bool operator>=(const Resources &res)
Resources & operator+=(const Resources &res)
const int sidenum
the number of sides that a field has; is now fixed at 6;
MapCoordinate3D(const MapCoordinate &mc, int bitmappedHeight)
void read(tnstream &stream)
const int mineremovemovedecrease
the movement cost for removing mines from the map
Resources operator/(const Resources &res1, float a)
const int maxbuildingpicnum
The maximum number of number of different images for a building and a weather. For example...
const int maxminingrange
The maximum number of fields a mining station can extract mineral resources from; Counted from its en...
const int minimumBuildingDamageForConquering
if a building has at least this amount of damage, then any unit can conquer the build (and not only u...
const int resourceTypeNum
The number of different resources that ASC uses.
IntRange(int from_, int to_)
void write(tnstream &stream) const
virtual void read(tnstream &stream)=0
read the binary representation of this item from the given stream
void write(tnstream &stream) const
An abstract base class that provides the interface for all kinds of items that ASC loads from disk...
const int destructoutput
the percentage of a units production cost that is reclaimed when the unit is salvaged ...
Coordinate on the twodimensional map.
ASCString getValue(const ASCString &key)
Resources operator*(const Resources &r) const
const int cmovemalitypenum
The number of vehicle categories; Each category has its own move malus.
Resources operator-(const Resources &res1, const Resources &res2)
const int destruct_building_material_get
when pulling down a building, this fraction of the buildings construction cost is reclaimed ...
void setnum(int _x, int _y, int numericalz)
Resources operator+(const Resources &res1, const Resources &res2)
represents a change of a MapCoordinate
The interface for the various streams that ASC offers, like file and memory streams.
const int attackmovecost
Constants that define the behaviour of units and buildings.
void setValue(const ASCString &key, const ASCString &value)
ASCString heightToString(int bitmappedHeight)
const int csolarkraftwerkleistung[]
bool operator!=(const MapCoordinate3D &mc) const
Represents a range of numbers, with a lower and upper boundary.
MapCoordinate3D(int _x, int _y, int bitmappedz)
const char * moveMaliTypeIcons[cmovemalitypenum]
filenames of icons representing the varios movemalus types
virtual ~LoadableItemType()
const int resourceNum
The number of different resources that ASC uses.
MapCoordinate & operator+=(const MapCoodinateVector &delta)
Resources operator*(const Resources &res1, float a)
const int resource_material_factor
int getheightdelta(int height1, int height2)
calculate the height difference between two levels of height.
const int generatortruckefficiency
the amount of fuel that a generator vehicle needs to produce one unit of energy
MapCoodinateVector(int dx, int dy)
const int maxunitexperience
The maximum experience value of a Vehicle.
int getBitmappedHeight() const
bool operator!=(const MapCoordinate &mc) const
const int gamemapPixelSize
the color depth of the gamemap
static const int fuelColor
Coordinate on the map including height.
a container that stores pointers and deletes the pointed-to objects on destruction ...
bool operator==(const MapCoordinate &mc) const
ASCString location
The filename and location on disk (including containerfiles) of the object.
a class for storing general key/values pairs. Intended as a mechanism to persist data from Lua script...
Resources are basically the currency of ASC.
static bool comp(const GameTime &a, const GameTime &b)
const int playerNum
the maximum number of players that ASC can manage.
const char * choehenstufen[8]
the names of the different levels of height
MapCoordinate(int _x, int _y)
void fatalError(const ASCString &string)
void write(tnstream &stream) const
void move(int width, int height)
a map that stores pointers as values and deletes the pointed-to objects on destruction ...
bool operator<(const MapCoordinate3D &mc) const
const int cwettertypennum
The number of different weather.
bool operator==(const Resources &res)
const char * cgeneralnetcontrol[]
const int cmm_trooper
the movemalus type of a trooper.
bool operator!=(const Resources &res)
bool operator==(const MapCoordinate3D &mc) const
const int maxwindspeed
Wind with its maximum strength of 255 is moving this distance per turn.
const int submarineMovement
the movemalus for all submerged units
const int resource_fuel_factor
the conversion factor between mineral resources in the ground and the normal game Resources at nomina...
static const int energyColor
void set(int turn, int move)
The MoveMalusType categorizes the different units (Vehicle) Originally, these types were only used to...