|
|
@ -31,12 +31,20 @@ void printSettlement(DFHack::API & DF, const DFHack::t_settlement & settlement,
|
|
|
|
|
|
|
|
|
|
|
|
int main (int argc,const char* argv[])
|
|
|
|
int main (int argc,const char* argv[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DFHack::API DF ("Memory.xml");
|
|
|
|
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;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DFHack::t_settlement current;
|
|
|
|
DFHack::t_settlement current;
|
|
|
|
uint32_t numSettlements;
|
|
|
|
uint32_t numSettlements;
|
|
|
|
if(!DF.InitReadSettlements(numSettlements))
|
|
|
|
if(!DF.InitReadSettlements(numSettlements))
|
|
|
@ -44,6 +52,7 @@ int main (int argc,const char* argv[])
|
|
|
|
cerr << "Could not read Settlements" << endl;
|
|
|
|
cerr << "Could not read Settlements" << endl;
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vector< vector<string> > englishWords;
|
|
|
|
vector< vector<string> > englishWords;
|
|
|
|
vector< vector<string> > foreignWords;
|
|
|
|
vector< vector<string> > foreignWords;
|
|
|
|
if(!DF.InitReadNameTables(englishWords,foreignWords))
|
|
|
|
if(!DF.InitReadNameTables(englishWords,foreignWords))
|
|
|
@ -51,6 +60,7 @@ int main (int argc,const char* argv[])
|
|
|
|
cerr << "Can't get name tables" << endl;
|
|
|
|
cerr << "Can't get name tables" << endl;
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cout << "Settlements\n";
|
|
|
|
cout << "Settlements\n";
|
|
|
|
/*for(uint32_t i =0;i<numSettlements;i++){
|
|
|
|
/*for(uint32_t i =0;i<numSettlements;i++){
|
|
|
|
DFHack::t_settlement temp;
|
|
|
|
DFHack::t_settlement temp;
|
|
|
@ -58,6 +68,7 @@ int main (int argc,const char* argv[])
|
|
|
|
printSettlement(DF,temp,englishWords,foreignWords);
|
|
|
|
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
|
|
|
|
// 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";
|
|
|
|
cout << "Current Settlement\n";
|
|
|
|
if(DF.ReadCurrentSettlement(current))
|
|
|
|
if(DF.ReadCurrentSettlement(current))
|
|
|
|
printSettlement(DF,current,englishWords,foreignWords);
|
|
|
|
printSettlement(DF,current,englishWords,foreignWords);
|
|
|
@ -65,6 +76,7 @@ int main (int argc,const char* argv[])
|
|
|
|
DF.FinishReadNameTables();
|
|
|
|
DF.FinishReadNameTables();
|
|
|
|
DF.FinishReadSettlements();
|
|
|
|
DF.FinishReadSettlements();
|
|
|
|
DF.Detach();
|
|
|
|
DF.Detach();
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
cout << "Done. Press any key to continue" << endl;
|
|
|
|
cout << "Done. Press any key to continue" << endl;
|
|
|
|
cin.ignore();
|
|
|
|
cin.ignore();
|
|
|
|