forked from DFHack/dfhack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaterialtest.cpp
More file actions
53 lines (44 loc) · 1.24 KB
/
Copy pathmaterialtest.cpp
File metadata and controls
53 lines (44 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <iostream>
#include <climits>
#include <integers.h>
#include <vector>
#include <ctime>
using namespace std;
#include <DFTypes.h>
#include <DFHackAPI.h>
int main (void)
{
DFHack::API DF("Memory.xml");
if(!DF.Attach())
{
cerr << "DF not found" << endl;
return 1;
}
vector <DFHack::t_matgloss> Woods;
DF.ReadWoodMatgloss(Woods);
vector <DFHack::t_matgloss> Plants;
DF.ReadPlantMatgloss(Plants);
vector <DFHack::t_matgloss> Metals;
DF.ReadMetalMatgloss(Metals);
vector <DFHack::t_matgloss> Stones;
DF.ReadStoneMatgloss(Stones);
vector <DFHack::t_matgloss> 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(int 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;
}