+
+/////////////////////////////////////////////////////////////////////
+//
+bool BSConf::loadStats()
+{
+ UnitList units;
+ QFile f(m_sStatsFilename);
+
+ if ( f.open(IO_ReadOnly) )
+ { // file opened successfully
+ QTextStream t( &f ); // use a text stream
+ QString s;
+ QString r;
+ string race;
+ while ( !t.eof() )
+ {
+ r = t.readLine(); // line of text excluding '\n'
+ race = (const char*) r;
+ s = t.readLine(); // line of text excluding '\n'
+ QTextStream t1(s,IO_ReadOnly );
+ t1.skipWhiteSpace();
+ while ( !t1.eof() )
+ {
+ QString temp;
+ units[race].setName(race);
+ t1 >> temp;
+ units[race].setRace(temp.toInt());
+ t1 >> temp;
+ units[race].setUnitClass((const char*) temp);
+ t1 >> temp;
+ units[race].addTarget((const char*) temp);
+ t1 >> temp;
+ units[race].addTarget((const char*) temp);
+ t1 >> temp;
+ units[race].addTarget((const char*) temp);
+ t1 >> temp;
+ units[race].setInitiative(temp.toInt());
+ t1 >> temp;
+ units[race].setAgility(temp.toInt());
+ t1 >> temp;
+ units[race].setWeaponSpeed(temp.toInt());
+ t1 >> temp;
+ units[race].setGuns(temp.toInt());
+ t1 >> temp;
+ units[race].setPower(temp.toInt());
+ t1 >> temp;
+ units[race].setArmor(temp.toInt());
+ t1 >> temp;
+ units[race].setEMP(temp.toInt());
+ QString metal;
+ QString crystal;
+ QString eonium;
+ t1 >> metal;
+ t1 >> crystal;
+ t1 >> eonium;
+ units[race].setResources(tr("metal").latin1(), metal.toInt());
+ units[race].setResources(tr("crystal").latin1(), crystal.toInt());
+ units[race].setResources(tr("eonium").latin1(), eonium.toInt());
+ //units[race].setTotalResources(metal.toInt() + crystal.toInt() + eonium.toInt());
+ t1 >> temp;
+ units[race].setFuel(temp.toInt());
+ t1 >> temp;
+ units[race].setETA(temp.toInt());
+ t1 >> temp;
+ units[race].setType((const char*) temp);
+ }
+ }
+ Fleet::setUnits(units);
+ }
+ return true;
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+bool BSConf::saveStats()
+{
+ return true;