/* This file is part of Advanced Strategic Command; http://www.asc-hq.de Copyright (C) 1994-2001 Martin Bickel, Marc Schellenberger and Steffen Froehlich This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Version v1.8 , change also GENERAL #include #include "../tpascal.inc" #include "../typen.h" #include "../basestrm.h" #include "../misc.h" #include "../sgstream.h" #include "../buildingtype.h" #include "../vehicletype.h" #include "../errors.h" #include "../graphicset.h" #include "../ascstring.h" #include "../itemrepository.h" #include "../strtmesg.h" // including the command line parser, which is generated by genparse #include "../clparser/weaponguide.cpp" int main(int argc, char *argv[] ) { Cmdline cl ( argc, argv ); if ( cl.v() ) { cout << argv[0] << " " << getVersionString() << endl; exit(0); } verbosity = cl.r(); initFileIO( cl.c().c_str() ); // passing the filename from the command line options try { loadpalette(); loadbi3graphics(); loadalltextfiles(); loadallobjecttypes(); loadallbuildingtypes(); loadallvehicletypes(); freetextdata(); char* wildcard; if ( cl.next_param() < argc ) { wildcard = argv[cl.next_param()]; // if a command line parameter is specified, use it as wildcard // for example: weaponguide s*.veh } else { wildcard = "*"; // else use all verhicles } FILE* overview = fopen ( "overview.html", "w" ); FILE* overview1 = fopen ( "overview1.html", "w" ); // opens a file for writing and assigns the file pointer overview to it // Beginn des HTML Files HEAD und BODY // \n is the sequence to start a new line fprintf ( overview , "\n" "\n" "UNITGUIDE OVERVIEW LEFT\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" ); fprintf ( overview1 , "\n" "\n" "WEAPONGUIDE OVERVIEW PICTURES\n" "\n" "\n" "\n" "\n" "\n" ); for ( int unit = 0; unit < vehicletypenum; unit++ ) { pvehicletype ft = getvehicletype_forpos ( unit ); ASCString fn = extractFileName_withoutSuffix( ft->filename ); if ( patimat ( wildcard, ft->filename.c_str() )) { ASCString cn = fn; cn.toLower(); // now we are cycling through all files that match wildcard printf(" processing unit %s , ID %d ... ", ft->description.c_str(), ft->id ); string s, s1, s2, s3, s4, s5, s6, b1, b2; s = s1 = s2 = s3 = s4 = s5 = s6 = b1 = b2 = cn; // this is a C++ string which is much more powerful than the standard C strings ( char* ) s += ".html"; // frame s1 += "1.html"; // general s2 += "2.html"; // movement s3 += "3.html"; // weapon s4 += "4.html"; // functions s5 += "5.html"; // loading s6 += "6.html"; // description b1 += ".gif"; // little pic b2 += ".jpg"; // big pic FILE* detailed = fopen ( s.c_str(), "w" ); FILE* detailed1 = fopen ( s1.c_str(), "w" ); FILE* detailed2 = fopen ( s2.c_str(), "w" ); FILE* detailed3 = fopen ( s3.c_str(), "w" ); FILE* detailed4 = fopen ( s4.c_str(), "w" ); FILE* detailed5 = fopen ( s5.c_str(), "w" ); FILE* detailed6 = fopen ( s6.c_str(), "w" ); // c_str() converts a c++ string back to a c string which fopen requires // Beginn Einzelfiles // UNIT FRAME fprintf ( detailed, "\n" "\n" "UNITGUIDE FRAME\n" "\n" "\n" "\n" "<body><p>Diese Seite verwendet Frames. Frames werden von Ihrem Browser aber nicht unterstützt.</p></body>\n" "\n" "\n", s1.c_str() , s6.c_str() ); // UNIT GENERAL fprintf ( detailed1, "\n" "\n" "UNITGUIDE GENERAL\n" " \n" "\n" "\n" "\n" "\n" ); // UNIT TERRAIN fprintf ( detailed2, "\n" "\n" "UNITGUIDE MOVEMENT\n" " \n" "\n" "\n" "\n" "\n" ); // UNIT WEAPONS fprintf ( detailed3, "\n" "\n" "UNITGUIDE TERRAIN\n" " \n" "\n" "\n" "\n" "\n" ); // UNIT FUNCTIONS fprintf ( detailed4, "\n" "\n" "UNITGUIDE FUNCTIONS\n" " \n" "\n" "\n" "\n" "\n" ); // UNIT LOADING fprintf ( detailed5, "\n" "\n" "UNITGUIDE LOADING\n" " \n" "\n" "\n" "\n" "\n" ); // UNIT DESCRIPTION fprintf ( detailed6, "\n" "\n" "UNITGUIDE DESCRIPTION\n" " \n" "\n" "\n" "\n" "\n" ); // OVERVIEW LEFT fprintf ( overview, " \n" ); // OVERVIEW RIGHT fprintf ( overview1, "
SEE PICTURES
", s.c_str() ); fprintf ( overview, "%s", ft->getName().c_str() ); fprintf ( overview, "
\n" "
" ); if ( exist ( b1.c_str() )) fprintf ( overview1, "", b1.c_str() ); fprintf ( overview1, "%s
%s
\n", s.c_str(), ft->name.c_str(), s.c_str(), ft->description.c_str() ); // END OVERVIEW RIGHT // we are adding a link to the overview file. // to put a singile " into a string we must use double quotes ( "" ), because a single quote is interpreted as the end of the string by C // %s tells C to insert a string there. The strings are appended at the end of the command // at the first %s the filename in s is inserted, at the second %s the unit variable 'description' // UNIT GENERAL fprintf ( detailed1, " \n" "" "\n\n\n
UNIT GUIDE v1.8
" ); if ( exist ( b1.c_str() )) fprintf ( detailed1, "", b1.c_str() ); fprintf ( detailed1, "" ); fprintf ( detailed1, " \n" ); fprintf ( detailed1, "\n", ft->name.c_str() ); if ( !ft->description.empty() ) fprintf ( detailed1, "\n", ft->description.c_str() ); else fprintf ( detailed1, "\n" ); fprintf ( detailed1, "\n", ft->id, ft->weight, cmovemalitypes[ft->movemalustyp] ); fprintf ( detailed1, "\n", ft->armor, (ft->view/10) ); fprintf ( detailed1, "\n", ft->productionCost.material, (ft->jamming/10) ); fprintf ( detailed1, "\n", ft->productionCost.energy ); if ( ft->wait ) fprintf ( detailed1, "\n" ); else fprintf ( detailed1, "\n" ); if ( ft->functions & cf_moveafterattack ) fprintf ( detailed1, "\n" ); else fprintf ( detailed1, "\n" ); fprintf ( detailed1, "
Name %s
Description %s
Description --
ID %i Weight %d Type%s
Armor %i View %d
Cost energy %i Jamming%d
Cost material%i
Attack after move No
Attack after move Yes
Move after Attack Yes
Move after Attack No
\n" ); fprintf ( detailed1, "
" ); if ( exist ( b2.c_str() )) fprintf ( detailed1, "", b2.c_str() ); fprintf ( detailed1, "
\n" ); fprintf ( detailed1, "\n" ); fprintf ( detailed1, "", s2.c_str() ); fprintf ( detailed1, "" , s3.c_str() ); fprintf ( detailed1, "" , s4.c_str() ); fprintf ( detailed1, "" , s5.c_str() ); fprintf ( detailed1, "" , s6.c_str() ); // fprintf ( detailed1, "" , s4.c_str() ); fprintf ( detailed1, "
MovementWeaponsFunctionsLoadingDescriptionResearch
\n" ); // END UNIT GENERAL // some details about the unit; %d tells C to insert a decimal number there // take a look at the vehicletype class in vehicletype.h for the names of all variables that make a vehicletype // be carefuel not to make a , at the end of the first lines, since this would seperate the string in to several independant strings // choehenstufen is a global array that contains the names of the height levels // BEGIN MOVEMENT // Hoehenstufen int i,w; // Tabellenbeginn fprintf( detailed2, "" "\n"); // Spaltentitel fprintf ( detailed2, "" ); for ( i = 0; i < 8; i++ ) fprintf ( detailed2, " ", i); fprintf( detailed2, "\n"); // Spaltenwerte Hacken fprintf ( detailed2, "" ); for ( i = 0; i < 8; i++ ) if ( ft->height & ( 1 << i )) fprintf ( detailed2, " " ); else fprintf ( detailed2, " " ); fprintf( detailed2, "\n"); // Spaltenwerte pro Runde fprintf ( detailed2, "" ); for ( i = 0; i < 8; i++ ) if ( ft->height & ( 1 << i )) fprintf ( detailed2, " ", (ft->movement[i]/10) ); else fprintf ( detailed2, " " ); fprintf( detailed2, "\n\n"); /* ???? // Spaltenwerte Maximum fprintf ( detailed2, "" ); for ( i = 0; i < 8; i++ ) if ( (ft->height & ( 1 << i )) && ft->fuelConsumption ) fprintf ( detailed2, " ", ft->tank.fuel/ft->fuelConsumption ); else fprintf ( detailed2, " " ); */ fprintf( detailed2, "\n\n
Reachable levels of height:
Round%d
Max.%d
\n"); // Einzelne Werte // Tabellenbeginn fprintf( detailed2, "\n" ); fprintf( detailed2, "\n", ft->tank.fuel ); fprintf( detailed2, "\n", ft->tank.material ); fprintf( detailed2, "\n", ft->tank.energy ); fprintf( detailed2, "\n", ft->fuelConsumption ); if ( ft->fuelConsumption > 0 ) fprintf( detailed2, "\n", (ft->tank.fuel/ft->fuelConsumption) ); else fprintf( detailed2, "\n" ); fprintf( detailed2, "\n", ft->steigung ); fprintf( detailed2, "\n
Fuel tank %d
Material tank%d
Energy tank %d
Consumption %d
Max.Movem. %d
Max.Movem. --
*Steigung* %d
\n"); // Bodentypen global fprintf( detailed2,"

\n\n" ); // Spalten gfx fprintf ( detailed2, "" ); for ( int i = 0; i < cbodenartennum ; i++ ) fprintf ( detailed2, " ", i, cbodenarten[i]); fprintf( detailed2, "\n\n"); // Spaltenwerte befahrbare Bodentypen fprintf ( detailed2, "" ); for ( int i = 0; i < cbodenartennum ; i++) { if ( ft->terrainaccess.terrain.test(i) ) fprintf ( detailed2, "" ); else fprintf ( detailed2, "" ); } /* endfor */ fprintf( detailed2, "\n\n"); // Spaltenwerte stirbt auf fprintf ( detailed2, "" ); for ( i = 0; i < cbodenartennum ; i++) { if ( ft->terrainaccess.terrainkill.test(i)) fprintf ( detailed2, "" ); else fprintf ( detailed2, "" ); } /* endfor */ fprintf( detailed2, "\n\n"); // Spaltenwerte can not drive on fprintf ( detailed2, "" ); for ( i = 0; i < cbodenartennum ; i++) { if ( ft->terrainaccess.terrainnot.test(i) ) fprintf ( detailed2, "" ); else fprintf ( detailed2, "" ); } /* endfor */ fprintf ( detailed2, "\n" ); // Spaltenwerte can need terrain fprintf ( detailed2, "" ); for ( i = 0; i < cbodenartennum ; i++) { if ( ft->terrainaccess.terrainreq.test(i) ) fprintf ( detailed2, "" ); else fprintf ( detailed2, "" ); } /* endfor */ fprintf ( detailed2, "
" ); fprintf( detailed2,"Terraintypes for not flying units:
\"%s\"
can drive on
dies on
not drive on
required
\n" ); // ENDE MOVEMENT // BEGIN WEAPONS // Waffen NR-AMMO-DISTANCE-STRENGS-SHOT FROM-ATTACK TO-TYP fprintf ( detailed3, " \n" ); // Überschriften fprintf ( detailed3, "" " " " " " " " " " " "\n" ); // GFX fprintf ( detailed3, "" " ", i); fprintf (detailed3, " "); for ( i = 0; i < 8; i++ ) fprintf ( detailed3, " ", i); fprintf ( detailed3, " " "\n" ); // Werte der Waffen for ( w = 0; w < ft->weapons.count ; w++) { fprintf ( detailed3, "", w+1 ); fprintf ( detailed3, " ", ft->weapons.weapon[w].count ); fprintf ( detailed3, " ", (ft->weapons.weapon[w].mindistance+9)/10 ); fprintf ( detailed3, " ", ft->weapons.weapon[w].maxstrength ); fprintf ( detailed3, " ", (ft->weapons.weapon[w].maxdistance)/10 ); fprintf ( detailed3, " ", ft->weapons.weapon[w].minstrength ); // Höhenstufenzeichen einfügen für shoot from und target for ( i = 0; i < 8; i++ ) if ( ft->weapons.weapon[w].sourceheight & ( 1 << i ) ) fprintf ( detailed3, " " ); else fprintf ( detailed3, "" ); fprintf ( detailed3, " "); for ( i = 0; i < 8; i++ ) if ( ft->weapons.weapon[w].targ & ( 1 << i ) ) fprintf ( detailed3, "" ); else fprintf ( detailed3, "" ); fprintf ( detailed3, " \n" ); } fprintf ( detailed3, "
Distance can shot from: attack to: Type
" " " " " " " " " ); // Höhenstufenzeichen einfügen für shoot from und target for ( i = 0; i < 8; i++ ) fprintf ( detailed3, "
#%d%d%d%d%d%d" ); for ( int i = 0; i < cwaffentypennum; i++ ) if ( ft->weapons.weapon[w].typ & ( 1 << i ) ) fprintf ( detailed3, "%s.", cwaffentypen[i] ); fprintf ( detailed3, "
\n" ); fprintf ( detailed3, "
\n\n" ); // Die entfernung wird durch 10 dividiert, um die Anzahl der Felder zu erhalten // Die normale Division rundet IMMER ab, also 1,9 / 2 = 0 // Aber die minimale Entfernung muß aufgerundet werden, deshalb benutze ich einen kleinen Trick: Ich addiere vor der Division 9 (also Quotient-1) dazu //Weapon can hit: fprintf ( detailed3, " \n" ); // Ueberschrift fprintf ( detailed3, "" ); // Spalten GFX fprintf ( detailed3, "" ); for ( i = 0; i < cmovemalitypenum; i++ ) fprintf ( detailed3, " ", i); fprintf ( detailed3, "\n"); // Spaltenwerte for ( int w = 0; w < ft->weapons.count ; w++) { fprintf ( detailed3, "", w+1 ); for ( i = 0; i < cmovemalitypenum; i++ ) if ( !(ft->weapons.weapon[w].targets_not_hittable & ( 1 << i )) ) fprintf ( detailed3, "" ); else fprintf ( detailed3, "" ); fprintf ( detailed3, "\n"); } //Ende tabelle fprintf ( detailed3, "
The weapon can hit:
#%d

\n" ); // Effizienz fprintf ( detailed3, " \n" ); // Ueberschrift fprintf ( detailed3, "\n" ); // Spalten Ueberschrift fprintf ( detailed3, "" ); for ( i = 0; i < 13; i++ ) fprintf(detailed3, "", i-6 ); fprintf ( detailed3, "\n"); // Spaltenwerte for ( int w = 0; w < ft->weapons.count ; w++) { fprintf ( detailed3, "", w+1 ); for ( i = 0; i < 13; i++ ) fprintf ( detailed3, "", ft->weapons.weapon[w].efficiency[i] ); fprintf ( detailed3, "\n"); } //Ende tabelle fprintf ( detailed3, "
Efficiency over high difference:
%d
#%d%d%%
\n" ); //ENDE WAFFEN //BEGINN FUNCTIONS fprintf ( detailed4, "" ); // Ueberschrift fprintf ( detailed4, "" ); for ( int i = 0; ifunctions & ( 1 << i )) fprintf ( detailed4, "", cvehiclefunctions[i] ); //Ende tabelle fprintf ( detailed4, "
Special Unit functions
%s
\n" ); //Einzelwerte fprintf ( detailed4, "" ); if ( ft->maxwindspeedonwater ) fprintf ( detailed4, "", ft->maxwindspeedonwater ); else fprintf ( detailed4, "" ); fprintf ( detailed4, "", ft->digrange ); fprintf ( detailed4, "", ft->autorepairrate ); // fprintf ( detailed4, "/n", ft->maxunitweight ); fprintf ( detailed4, "
Max. windspeed on water %d
Max. windspeed on water --
Ressource search range%d
Auto repair rate %d
Max. unit weight%d
\n" ); // Objekte fprintf ( detailed4, "\n" ); // Ueberschrift baubare Objekte fprintf ( detailed4, "\n" ); for ( unsigned int i = 0; i < ft->objectsBuildable.size(); i++ ) { // fprintf( detailed4, "\n", ft->objectsBuildable[i].from, ft->objectsBuildable[i].to ); for ( int b = 0; b < objecttypenum; b++ ) { pobjecttype obj = getobjecttype_forpos ( b ); if ( obj->id >= ft->objectsBuildable[i].from && obj->id <= ft->objectsBuildable[i].to ) { fprintf ( detailed4, "\n", obj->id, obj->name.c_str() ); } } } fprintf ( detailed4, "
baubare OBJEKTE
es können die Objekte mit ids von %d bis %d gebaut werden
ID %d %s
\n" ); // UNITS fprintf ( detailed4, "\n" ); // Ueberschrift baubare Einheiten fprintf ( detailed4, "\n" ); for ( unsigned int i = 0; i < ft->vehiclesBuildable.size(); i++ ) { // fprintf( detailed4, "\n", ft->vehiclesBuildable[i].from, ft->vehiclesBuildable[i].to ); for ( int b = 0; b < vehicletypenum; b++ ) { pvehicletype veh = getvehicletype_forpos ( b ); if ( veh->id >= ft->vehiclesBuildable[i].from && veh->id <= ft->vehiclesBuildable[i].to ) { fprintf ( detailed4, "\n", veh->id, veh->getName().c_str() ); } } } fprintf ( detailed4, "
baubare UNITS
baubar ID %d bis %d
ID %d %s
\n" ); // Gebäude fprintf ( detailed4, "\n" ); // Ueberschrift baubare Gebaeude fprintf ( detailed4, "\n" ); for ( unsigned int i = 0; i < ft->buildingsBuildable.size(); i++ ) { // fprintf( detailed4, "\n", ft->buildingsBuildable[i].from, ft->vehiclesBuildable[i].to ); for ( int b = 0; b < buildingtypenum; b++ ) { pbuildingtype bld = getbuildingtype_forpos ( b ); if ( bld->id >= ft->buildingsBuildable[i].from && bld->id <= ft->buildingsBuildable[i].to ) { fprintf ( detailed4, "\n", bld->id, bld->name.c_str() ); } } } fprintf ( detailed4, "
baubare GEBÄUDE
baubar ID %d bis %d
ID %d %s
\n" ); //ENDE FUNKTIONS //BEGINN LOADING if ( ft->loadcapacity ) { fprintf ( detailed5, " " ); fprintf ( detailed5, "" ); for ( int c = 0; c < cmovemalitypenum; c++ ) if ( ft->vehicleCategoriesLoadable & (1 << c)) fprintf ( detailed5, "", cmovemalitypes[c] ); fprintf ( detailed5, "
Einladbare UNITS
%s
" ); fprintf ( detailed5, "" ); fprintf ( detailed5, "", ft->loadcapacity ); fprintf ( detailed5, "", ft->maxunitweight ); fprintf ( detailed5, "
max. Zuladung %d
max. Gewicht einer Einheit%d
" ); // Ladbar von Höhenstufen fprintf ( detailed5, " \n" ); // Überschriften fprintf ( detailed5, " " "\n" ); // GFX fprintf ( detailed5, "\n"); // Höhenstufenzeichen einfügen für shoot from und target for ( i = 0; i < 8; i++ ) fprintf ( detailed5, " ", i); fprintf ( detailed5, "\n" ); // Höhenstufenzeichen einfügen für can load and unload from: fprintf ( detailed5, "" ); for ( int h = 0; h < 8; h++ ) { if ( ft->loadcapability & (1 << h)) fprintf ( detailed5, " " ); else fprintf ( detailed5, "" ); } fprintf ( detailed5, "\n" ); // Höhenstufenzeichen einfügen für can load and unload from: fprintf ( detailed5, "" ); for ( int h = 0; h < 8; h++ ) { if ( ft->loadcapabilityreq & (1 << h)) fprintf ( detailed5, " " ); else fprintf ( detailed5, "" ); } fprintf ( detailed5, "\n" ); // Höhenstufenzeichen einfügen für can load and unload from: fprintf ( detailed5, "" ); for ( int h = 0; h < 8; h++ ) { if ( ft->loadcapabilitynot & (1 << h)) fprintf ( detailed5, " " ); else fprintf ( detailed5, "" ); } fprintf ( detailed5, "\n" ); fprintf ( detailed5, "
Voraussetzungen für das Ein- und Ausladen
UNIT muss auf dieser Stufe sein
UNIT muss diese Stufe selbst erreichen
UNIT darf diese Stufe selbst nicht erreichen
\n" ); } else { fprintf ( detailed5, "" ); fprintf ( detailed5, "" ); fprintf ( detailed5, "" ); fprintf ( detailed5, "
Loadable units

No transport unit!
" ); } //ENDE LOADING //BEGINN DESCRIPTION fprintf ( detailed6, "" ); fprintf ( detailed6, "" ); if ( !ft->infotext.empty() ) { string text = ft->infotext; if ( text.find ( "#color0#" ) != string::npos ) text.replace ( text.find ("#color0#"), 8, " "); if ( text.find ( "#color1#" ) != string::npos ) text.replace ( text.find ("#color1#"), 8, " "); if ( text.find ( "#color2#" ) != string::npos ) text.replace ( text.find ("#color2#"), 8, " "); if ( text.find ( "#color3#" ) != string::npos ) text.replace ( text.find ("#color3#"), 8, " "); if ( text.find ( "#color4#" ) != string::npos ) text.replace ( text.find ("#color4#"), 8, " "); if ( text.find ( "#font0#" ) != string::npos ) text.replace ( text.find ("#font0#"), 7, " "); if ( text.find ( "#font1#" ) != string::npos ) text.replace ( text.find ("#font1#"), 7, " "); if ( text.find ( "#font2#" ) != string::npos ) text.replace ( text.find ("#font2#"), 7, " "); if ( text.find ( "#crt#" ) != string::npos ) text.replace ( text.find ("#crt#"), 5, " "); fprintf ( detailed6, "", text.c_str() ); } // fprintf ( detailed6, "", ft->infotext ); else { fprintf ( detailed6, "" ); } //Ende tabelle fprintf ( detailed6, "
Unit description

%s


%s


No description available !

\n" ); //ENDE DESCRIPTION /* // NEU - noch anzupassen for ( int h = 0; h < 8; h++ ) { if ( ft->loadcapability & (1 << h)) printf("H÷henstufe kann geladen werden" ); if ( ft->loadcapabilityreq & (1 << h)) printf("H÷henstufe mu¯ erreichbar sein, um geladen werden zu k÷nnen" ); if ( ft->loadcapability & (1 << h)) printf("H÷henstufe darf nicht erreichbar sein" ); } // ft->loadcapacity ist maximale ladekapazitõt for ( int c = 0; c < cmovemalitypenum; c++ ) if ( ft->vehicleCategoriesLoadable & (1 << c)) printf(" Kategorie %s kann geladen werden", cmovemalitypes[c] ); for ( i = 0; i < ft->buildingsBuildable.size(); i++ ) { printf("es können die gebäude mit ids von %d bis %d gebaut werden\n", ft->buildingsBuildable[i].from, ft->buildingsBuildable[i].to ); for ( int b = 0; b < buildingtypenum; b++ ) { pbuildingtype bld = getbuildingtype_forpos ( b ); if ( bld->id >= ft->buildingsBuildable[i].from && bld->id <= ft->buildingsBuildable[i].to ) { printf( "das gebõude mit id %d und dem Namen %s kann gebaut werden\n", bld->id, bld->name.c_str() ); } } } */ /* for ( int i = 0; i < ft->vehiclesBuildable.size(); i++ ) { printf("es können die einheiten mit ids von %d bis %d gebaut werden\n", ft->vehiclesBuildable[i].from, ft->vehiclesBuildable[i].to ); for ( int b = 0; b < vehicletypenum; b++ ) { pvehicletype veh = getvehicletype_forpos ( b ); if ( veh->id >= ft->vehiclesBuildable[i].from && veh->id <= ft->vehiclesBuildable[i].to ) { printf( "die einheit mit id %d und dem Namen %s kann gebaut werden\n", veh->id, veh->getName().c_str() ); } } } */ /* for ( int i = 0; i < ft->objectsBuildable.size(); i++ ) { printf("es können die Objekte mit ids von %d bis %d gebaut werden\n", ft->objectsBuildable[i].from, ft->objectsBuildable[i].to ); for ( int b = 0; b < objecttypenum; b++ ) { pobjecttype obj = getobjecttype_forpos ( b ); if ( obj->id >= ft->objectsBuildable[i].from && obj->id <= ft->objectsBuildable[i].to ) { printf( "die einheit mit id %d und dem Namen %s kann gebaut werden\n", obj->id, obj->name.c_str() ); } } } */ // ABSCHLU˜ DER DOKUMENTE fprintf ( detailed1, "\n"); fprintf ( detailed2, "\n"); fprintf ( detailed3, "\n"); fprintf ( detailed4, "\n"); fprintf ( detailed5, "\n"); fprintf ( detailed6, "\n"); // Ende des Einheiten Dokuments fclose ( detailed ); fclose ( detailed1 ); fclose ( detailed2 ); fclose ( detailed3 ); fclose ( detailed4 ); fclose ( detailed5 ); fclose ( detailed6 ); // closing the file printf(" done \n" ); // we are writing this not to a file, but the screen } } // Dokument Übersicht Ende fprintf( overview , "\n" ); fprintf ( overview1, "\n" ); fclose ( overview ); fclose ( overview1 ); } /* endtry */ catch ( tfileerror err ) { printf("\nfatal error accessing file %s \n", err.getFileName().c_str() ); return 1; } /* endcatch */ catch ( ASCexception ) { printf("\na fatal exception occured\n" ); return 2; } /* endcatch */ return 0; };