forked from Whales/Cataclysm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
construction.h
57 lines (49 loc) · 1.87 KB
/
construction.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
#include <vector>
#include <string>
#include "crafting.h"
struct construct;
struct construction_stage
{
ter_id terrain;
int time; // In minutes, i.e. 10 turns
std::vector<itype_id> tools[3];
std::vector<component> components[3];
construction_stage(ter_id Terrain, int Time) :
terrain (Terrain), time (Time) { };
};
struct constructable
{
int id;
std::string name; // Name as displayed
int difficulty; // Carpentry skill level required
std::vector<construction_stage> stages;
bool (construct::*able) (game *, point);
void (construct::*done) (game *, point);
constructable(int Id, std::string Name, int Diff,
bool (construct::*Able) (game *, point),
void (construct::*Done) (game *, point)) :
id (Id), name (Name), difficulty (Diff), able (Able), done (Done) {};
};
struct construct // Construction functions.
{
// Bools - able to build at the given point?
bool able_always(game *, point) { return true; }
bool able_never (game *, point) { return false; }
bool able_empty (game *, point); // Able if tile is empty
bool able_window(game *, point); // Any window tile
bool able_window_pane(game *, point); // Only intact windows
bool able_broken_window(game *, point); // Able if tile is broken window
bool able_door(game *, point); // Any door tile
bool able_door_broken(game *, point); // Broken door
bool able_wall (game *, point); // Able if tile is wall
bool able_wall_wood(game *g, point); // Only player-built walls
bool able_between_walls(game *, point); // Flood-fill contained by walls
bool able_dig(game *, point); // Able if diggable terrain
bool able_pit(game *, point); // Able only on pits
// Does anything special happen when we're finished?
void done_nothing(game *, point) { }
void done_pit(game *, point);
void done_trap_pit(game *, point);
void done_fill_pit(game *, point);
void done_window_pane(game *, point);
};