-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentity.h
53 lines (39 loc) · 1.32 KB
/
entity.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
#ifndef ENTITY_H
#define ENTITY_H
#include <libtcod.h>
#include "item.h"
struct map;
struct goal;
struct item;
typedef struct entity
{
int x; // Position in the map
int y;
struct map* host_map; // The real map the entity lives in
struct map* known_map; // What the entity knows about host_map
TCOD_path_t path; // The path that the entity is currently following
TCOD_list_t seen; // Other seen entities;
TCOD_list_t seen_items;
TCOD_list_t inventory;
bool getting_item;
TCOD_list_t goal_stack;
TCOD_color_t color; // Colour to draw with
char c; // The character to represent the entity
} entity;
entity* entity_new(int x, int y, char c, TCOD_color_t color);
void entity_delete(entity* e);
bool entity_move(entity* e, int x, int y);
void entity_look(entity* e);
void entity_set_map(entity* e, struct map* m);
bool entity_set_destination(entity* e, int x, int y);
bool entity_follow_path(entity* e);
bool entity_at_destination(entity* e);
void entity_add_goal(entity* e, struct goal* g);
void entity_do_goal(entity* e);
void entity_get_item(entity* e, struct item* i);
void entity_drop_item(entity* e, struct item* i);
bool entity_can_make_item(entity* e, item_type it);
bool entity_make_item(entity* e, item_type it);
bool entity_has_item(entity* e, struct item* i);
int entity_has_item_type(entity* e, item_type type);
#endif