2009-11-02 05:53:39 -07:00
|
|
|
#include <iostream>
|
|
|
|
#include <climits>
|
|
|
|
#include <integers.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <ctime>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#include <DFTypes.h>
|
|
|
|
#include <DFHackAPI.h>
|
|
|
|
|
|
|
|
int main (void)
|
|
|
|
{
|
2009-11-10 20:37:28 -07:00
|
|
|
DFHack::API DF("Memory.xml");
|
2010-03-26 06:01:46 -06:00
|
|
|
try
|
2009-11-02 05:53:39 -07:00
|
|
|
{
|
2010-03-26 06:01:46 -06:00
|
|
|
DF.Attach();
|
|
|
|
}
|
|
|
|
catch (exception& e)
|
|
|
|
{
|
|
|
|
cerr << e.what() << endl;
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
cin.ignore();
|
|
|
|
#endif
|
2009-11-02 05:53:39 -07:00
|
|
|
return 1;
|
|
|
|
}
|
2010-03-26 06:01:46 -06:00
|
|
|
|
2010-03-26 06:38:49 -06:00
|
|
|
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();
|
|
|
|
|
2010-02-10 19:03:22 -07:00
|
|
|
vector <DFHack::t_matgloss> Woods;
|
2010-02-22 15:34:20 -07:00
|
|
|
DF.ReadWoodMatgloss(Woods);
|
2010-02-10 19:03:22 -07:00
|
|
|
|
2009-12-12 17:47:58 -07:00
|
|
|
vector <DFHack::t_matgloss> Plants;
|
2009-11-02 05:53:39 -07:00
|
|
|
DF.ReadPlantMatgloss(Plants);
|
|
|
|
|
2009-12-12 17:47:58 -07:00
|
|
|
vector <DFHack::t_matgloss> Metals;
|
2009-11-02 05:53:39 -07:00
|
|
|
DF.ReadMetalMatgloss(Metals);
|
|
|
|
|
2009-12-12 17:47:58 -07:00
|
|
|
vector <DFHack::t_matgloss> Stones;
|
2009-11-02 05:53:39 -07:00
|
|
|
DF.ReadStoneMatgloss(Stones);
|
|
|
|
|
2009-12-12 17:47:58 -07:00
|
|
|
vector <DFHack::t_matgloss> CreatureTypes;
|
2009-11-02 05:53:39 -07:00
|
|
|
DF.ReadCreatureMatgloss(CreatureTypes);
|
|
|
|
|
2010-02-10 19:03:22 -07:00
|
|
|
cout << "Wood: " << Woods[0].id << endl;
|
2009-11-02 05:53:39 -07:00
|
|
|
cout << "Plant: " << Plants[0].id << endl;
|
|
|
|
cout << "Metal: " << Metals[0].id << endl;
|
|
|
|
cout << "Stone: " << Stones[0].id << endl;
|
|
|
|
cout << "Creature: " << CreatureTypes[0].id << endl;
|
2010-02-26 14:22:10 -07:00
|
|
|
cout << endl;
|
|
|
|
cout << "Dumping all stones!" << endl;
|
2010-03-26 06:38:49 -06:00
|
|
|
for(uint32_t i = 0; i < Stones.size();i++)
|
2010-02-26 14:22:10 -07:00
|
|
|
{
|
|
|
|
cout << Stones[i].id << "$" << endl;;
|
|
|
|
}
|
2009-11-02 05:53:39 -07:00
|
|
|
|
|
|
|
DF.Detach();
|
2009-11-05 18:04:17 -07:00
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
cout << "Done. Press any key to continue" << endl;
|
2009-11-02 05:53:39 -07:00
|
|
|
cin.ignore();
|
2009-11-05 18:04:17 -07:00
|
|
|
#endif
|
2009-11-02 05:53:39 -07:00
|
|
|
|
|
|
|
return 0;
|
2009-12-13 14:03:19 -07:00
|
|
|
}
|