#include #include #include #include #include using namespace std; #include #include int main (void) { DFHack::API DF("Memory.xml"); try { DF.Attach(); } catch (exception& e) { cerr << e.what() << endl; #ifndef LINUX_BUILD cin.ignore(); #endif return 1; } if(!DF.InitMap()) { cerr << "No map loaded, it would be unsafe to enumerate materials" << endl; #ifndef LINUX_BUILD cin.ignore(); #endif return 1; } DF.DestroyMap(); vector Woods; DF.ReadWoodMatgloss(Woods); vector Plants; DF.ReadPlantMatgloss(Plants); vector Metals; DF.ReadMetalMatgloss(Metals); vector Stones; DF.ReadStoneMatgloss(Stones); vector CreatureTypes; DF.ReadCreatureMatgloss(CreatureTypes); cout << "Wood: " << Woods[0].id << endl; cout << "Plant: " << Plants[0].id << endl; cout << "Metal: " << Metals[0].id << endl; cout << "Stone: " << Stones[0].id << endl; cout << "Creature: " << CreatureTypes[0].id << endl; cout << endl; cout << "Dumping all stones!" << endl; for(uint32_t i = 0; i < Stones.size();i++) { cout << Stones[i].id << "$" << endl;; } DF.Detach(); #ifndef LINUX_BUILD cout << "Done. Press any key to continue" << endl; cin.ignore(); #endif return 0; }