37 "entry of building (not to be used for terrain)" ,
82 for (
int a = 0; a < 10; a++ )
92 for (
int a = 0; a < 10; a++ )
110 if ( (*
this & bts).any() ) {
143 img = &GraphicSetManager::Instance().getPic( bi_pict);
155 if ( bi_pict >= 0 ) {
156 return GraphicSetManager::Instance().getQuickView( bi_pict );
179 if ( moveMalusCount <= 0 ) {
181 moveMalusCount = stream.
readInt();
186 int mmcount = moveMalusCount;
187 if (mmcount < moveMalusCount )
188 mmcount = moveMalusCount;
190 int mmcount = moveMalusCount ;
193 for (
int j=0; j< mmcount ; j++ ) {
194 if (j < moveMalusCount ) {
203 push_back ( defaultValue );
213 for (
int m = 0; m < size(); m++ )
225 bool loadImage =
true;
229 for (
int j = 1; j < 8; j++ )
232 for (
int j = 0; j < 8; j++ )
236 if ( version == 1 ) {
242 defensebonus = stream.
readInt();
243 attackbonus = stream.
readInt();
244 basicjamming = stream.
readInt();
246 int move_maluscount = stream.
readUint8();
254 for (
int j = 1; j < 6; j++ )
257 move_malus.read( stream,
minmalq, move_maluscount );
276 image.read ( stream );
288 art.write ( stream );
292 for (
int m = 1; m< 6; m++ )
295 move_malus.write ( stream );
300 image.write ( stream );
306 int version = stream.
readInt();
315 ___loadWeather[ww] = stream.
readInt();
317 for (
int nf = 0; nf < 8; nf++ )
323 if ( ___loadWeather[i] ) {
344 for (
int m = 0; m < 8; m++ )
363 int size =
sizeof(*this);
374 int size =
sizeof(*this);
375 size += image.getMemoryFootprint();
377 size += quickView->getMemoryFootprint();
398 if ( (terrain & bts).any()
399 && (terrainreq & bts) == terrainreq
400 && (terrainnot & bts ).none()
403 if ( (terrainkill & bts).any() )
413 for (
int i = 0; i < 32; i++ )
414 if ( terrain1 & ( 1 << i ))
417 for (
int i = 0; i < 32; i++ )
418 if ( terrain2 & ( 1 << i ))
424 int terrain1 = stream.
readInt();
425 int terrain2 = stream.
readInt();
426 setInt ( terrain1, terrain2 );
433 for (
int i = 0; i < 32; i++ )
437 for (
int i = 0; i < 32; i++ )
468 if ( weatherBits.test(i) ) {
482 bool bi3pics =
false;
488 pc.
addBool (
"UseGFXpics", bi3pics,
false );
493 if ( terraintype->weather[i] ==
this )
499 s +=
strrr(terraintype->id);
502 pc.
addImage (
"picture", image, s,
true );
505 originalImageFilename = s;
507 pc.
addString(
"OriginalImageFilename", originalImageFilename );
515 if ( operations == 1 )
518 if ( operations == 2 )
528 pc.
addInteger (
"DefenseBonus", defensebonus, 0 );
529 pc.
addInteger (
"AttackBonus", attackbonus, 0 );
530 pc.
addInteger (
"BasicJamming", basicjamming, 0 );
533 if ( move_malus.size() == 0 )
534 move_malus.push_back (
minmalq );
536 move_malus.push_back ( move_malus[0] );
588 text +=
"Terrain properties of which one must be available:\n" ;
589 terrain.appendToString( text );
591 if ( !( brief && terrainreq.none() )) {
592 text +=
"\n\nTerrain properties that must all be set:\n" ;
593 terrainreq.appendToString( text );
596 if ( !( brief && terrainnot.none() )) {
597 text +=
"\n\nTerrain properties that must not be set:\n" ;
598 terrainnot.appendToString( text );
601 if ( !( brief && terrainkill.none() )) {
602 text +=
"\n\nTerrain properties that are fatal:\n" ;
603 terrainkill.appendToString( text );
void read(tnstream &stream, int defaultValue, int moveMalusCount=-1)
const char * graphicOperations[graphicOperationNum]
void addBool(const ASCString &name, bool &property)
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 write(tnstream &stream) const
write the binary representation of this item to the given stream
void snowify(Surface &s, bool adaptive)
void write(tnstream &stream) const
virtual int readInt(void)
Reads a 32 bit signed Integer. In the stream little-endian byte order is used and a translation is pe...
virtual ASCString getDeviceName()
returns the name of the stream.
void addImage(const ASCString &name, Surface &property, ASCString &fileName, bool applyFieldMask)
Weather * weather[cwettertypennum]
void addIntegerArray(const ASCString &name, vector< int > &property, bool required=true)
const int terrain_version
Functions to evaluate the parsed *.asctxt files.
virtual int readWord(void)
Reads a 16 bit unsigned Integer. In the stream little-endian byte order is used and a translation is ...
void appendToString(ASCString &text) const
const int graphicOperationNum
const char * weatherAbbrev[cwettertypennum]
A system that provides a set of images for vehicles, buildings, etc.
const char * terrainProperties[terrainPropertyNum]
The interface for all kinds of IO stream.
void read(tnstream &stream)
read the binary representation of this item from the given stream
void write(tnstream &stream) const
virtual Uint8 readUint8(void)
Reads a 8 bit unsigned Integer.
The ASCString class provides an abstract way to manipulate strings.
const int terrainPropertyNum
the number of bits that specify the terrain of a field
void read(tnstream &stream)
const OverviewMapImage * getQuickView()
ASCString extractFileName_withoutSuffix(const ASCString &filename)
virtual void writeString(const string &pc, bool binary=true)
writes the C++ String pc to the stream.
void runTextIO(PropertyContainer &pc)
void runTextIO(PropertyContainer &pc)
registers the properties of this item for loading/writing into asctxt files
TerrainBits getTerrainBitType(TerrainBitTypes tbt)
char * strrr(int a)
converts a to a string.
the properties of a terrain describing which units can move onto this field and which can't ...
ASCString toString(bool brief=true) const
TerrainBits terrainreq
ALL these bits must be set in the terrain.
const int cmovemalitypenum
The number of vehicle categories; Each category has its own move malus.
virtual void writeUint8(Uint8 c)
Writes a 8 bit unsigned Integer.
TerrainBits terrainnot
if one of these bits is set, the field will NOT be accessible
int accessible(const TerrainBits &bts) const
checks whether a field with the given terrainbits is accessible.
void addDFloatArray(const ASCString &name, vector< double > &property)
The IO for many basic classes and structurs of ACS.
vector< int > secondaryIDs
when loading a file and these IDs are encountered, this object will be used.
void readClassContainer(C &c, tnstream &stream)
void paint(Surface &s, SPoint pos)
displays the image on the screen coordinates x1/y1
TerrainBits terrainkill
if a terrain is not accessible AND one of these bits is matched, the unit will be destroyed ...
void read(tnstream &stream)
read the binary representation of this item from the given stream
virtual ASCString readString(bool includeCR=false)
Reads and returns a string.
void read(tnstream &stream)
void addInteger(const ASCString &name, int &property)
void setInt(int terrain1=0, int terrain2=0)
TerrainBits terrain
at least one of these bits must match on of the terrain
void write(tnstream &stream) const
virtual void closeBracket()
void addNamedInteger(const ASCString &name, int &property, int tagNum, const char **tags)
int getMemoryFootprint() const
const char * terrainProperty[terrainPropertyNum+1]
const char * weatherTags[cwettertypennum]
void writeClassContainer(const C &c, tnstream &stream)
virtual void openBracket(const ASCString &name)
the image for a TerrainType that is shown on the small map
int getMemoryFootprint() const
void megaBlitter(const Surface &src, Surface &dst, const SPoint &pos, const SourceColorTransformParameter &scmp=nullParam, const ColorMergerParameter &cmp=nullParam, const SourcePixelSelectorParameter spsp=nullParam, const TargetPixelSelectorParameter tpsp=nullParam)
void addString(const ASCString &name, ASCString &property)
bool find(const ASCString &name)
void fatalError(const ASCString &string)
void addTagArray(const ASCString &name, BitSet &property, int tagNum, const char **tags, bool inverted=false)
void runTextIO(PropertyContainer &pc)
registers the properties of this item for loading/writing into asctxt files
void write(tnstream &stream) const
write the binary representation of this item to the given stream
const int cwettertypennum
The number of different weather.
Functions to parse the *.asctxt files.