forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrafting.h
68 lines (58 loc) · 1.23 KB
/
crafting.h
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef _CRAFTING_H_
#define _CRAFTING_H_
#include <string>
#include <vector>
#include "itype.h"
#include "skill.h"
#include "rng.h"
#define MAX_DISPLAYED_RECIPES 18
enum craft_cat {
CC_NULL = 0,
CC_WEAPON,
CC_AMMO,
CC_FOOD,
CC_DRINK,
CC_CHEM,
CC_ELECTRONIC,
CC_ARMOR,
CC_MISC,
CC_NONCRAFT,
NUM_CC
};
struct component
{
itype_id type;
int count;
component() { type = itm_null; count = 0; }
component(itype_id TYPE, int COUNT) : type (TYPE), count (COUNT) {}
};
struct recipe {
int id;
itype_id result;
craft_cat category;
Skill *sk_primary;
Skill *sk_secondary;
int difficulty;
int time;
bool reversible; // can the item be disassembled?
std::vector<component> tools[20];
std::vector<component> components[20];
recipe() {
id = 0;
result = itm_null;
category = CC_NULL;
sk_primary = NULL;
sk_secondary = NULL;
difficulty = 0;
time = 0;
reversible = false;
}
recipe(int pid, itype_id pres, craft_cat cat, const char *p1, const char *p2,
int pdiff, int ptime, bool preversible) :
id (pid), result (pres), category (cat), difficulty (pdiff), time (ptime), reversible (preversible)
{
sk_primary = p1?Skill::skill(p1):NULL;
sk_secondary = p2?Skill::skill(p2):NULL;
}
};
#endif