|
|
|
@ -32,11 +32,19 @@ void printSettlement(DFHack::API & DF, const DFHack::t_settlement & settlement,
|
|
|
|
|
int main (int argc,const char* argv[])
|
|
|
|
|
{
|
|
|
|
|
DFHack::API DF("Memory.xml");
|
|
|
|
|
if(!DF.Attach())
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
cerr << "DF not found" << endl;
|
|
|
|
|
DF.Attach();
|
|
|
|
|
}
|
|
|
|
|
catch (exception& e)
|
|
|
|
|
{
|
|
|
|
|
cerr << e.what() << endl;
|
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
|
cin.ignore();
|
|
|
|
|
#endif
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DFHack::t_settlement current;
|
|
|
|
|
uint32_t numSettlements;
|
|
|
|
|
if(!DF.InitReadSettlements(numSettlements))
|
|
|
|
@ -44,6 +52,7 @@ int main (int argc,const char* argv[])
|
|
|
|
|
cerr << "Could not read Settlements" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vector< vector<string> > englishWords;
|
|
|
|
|
vector< vector<string> > foreignWords;
|
|
|
|
|
if(!DF.InitReadNameTables(englishWords,foreignWords))
|
|
|
|
@ -51,6 +60,7 @@ int main (int argc,const char* argv[])
|
|
|
|
|
cerr << "Can't get name tables" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cout << "Settlements\n";
|
|
|
|
|
/*for(uint32_t i =0;i<numSettlements;i++){
|
|
|
|
|
DFHack::t_settlement temp;
|
|
|
|
@ -58,6 +68,7 @@ int main (int argc,const char* argv[])
|
|
|
|
|
printSettlement(DF,temp,englishWords,foreignWords);
|
|
|
|
|
}*/
|
|
|
|
|
// MSVC claims this is causing the heap to be corrupted, I think it is because the currentSettlement vector only has 1 item in it
|
|
|
|
|
|
|
|
|
|
cout << "Current Settlement\n";
|
|
|
|
|
if(DF.ReadCurrentSettlement(current))
|
|
|
|
|
printSettlement(DF,current,englishWords,foreignWords);
|
|
|
|
@ -65,6 +76,7 @@ int main (int argc,const char* argv[])
|
|
|
|
|
DF.FinishReadNameTables();
|
|
|
|
|
DF.FinishReadSettlements();
|
|
|
|
|
DF.Detach();
|
|
|
|
|
|
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
|
cout << "Done. Press any key to continue" << endl;
|
|
|
|
|
cin.ignore();
|
|
|
|
|