forked from Whales/Cataclysm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crafting.h
56 lines (47 loc) · 1.13 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
#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_SCRAFT1,
CC_FOOD,
CC_ELECTRONIC,
CC_ARMOR,
CC_SMITH,
CC_MISC,
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;
std::vector<component> tools[5];
std::vector<component> components[5];
recipe() { id = 0; result = itm_null; category = CC_NULL; sk_primary = sk_null;
sk_secondary = sk_null; difficulty = 0; time = 0; }
recipe(int pid, itype_id pres, craft_cat cat, skill p1, skill p2, int pdiff,
int ptime) :
id (pid), result (pres), category (cat), sk_primary (p1), sk_secondary (p2),
difficulty (pdiff), time (ptime) {}
};
void consume_items(game *g, std::vector<component> components);
void consume_tools(game *g, std::vector<component> tools);
#endif