Angband
player-history.h
Go to the documentation of this file.
1 
19 #ifndef HISTORY_H
20 #define HISTORY_H
21 
22 #include "angband.h"
23 
27 enum {
28  #define HIST(a, b) HIST_##a,
29  #include "list-history-types.h"
30  #undef HIST
31 
32  HIST_MAX
33 };
34 
35 
36 #define HIST_SIZE FLAG_SIZE(HIST_MAX)
37 
38 #define hist_has(f, flag) flag_has_dbg(f, HIST_SIZE, flag, #f, #flag)
39 #define hist_on(f, flag) flag_on_dbg(f, HIST_SIZE, flag, #f, #flag)
40 #define hist_off(f, flag) flag_off(f, HIST_SIZE, flag)
41 #define hist_wipe(f) flag_wipe(f, HIST_SIZE)
42 #define hist_copy(f1, f2) flag_copy(f1, f2, HIST_SIZE)
43 
47 struct history_info {
48  bitflag type[HIST_SIZE];/* Kind of history item */
49  s16b dlev; /* Dungeon level when this item was recorded */
50  s16b clev; /* Character level when this item was recorded */
51  byte a_idx; /* Artifact this item relates to */
52  s32b turn; /* Turn this item was recorded on */
53  char event[80]; /* The text of the item */
54 };
55 
56 extern struct history_info *history_list;
57 
58 void history_clear(void);
59 size_t history_get_num(void);
60 bool history_add_full(bitflag *type, struct artifact *artifact, s16b dlev, s16b clev, s32b turn, const char *text);
61 bool history_add(const char *event, int type, struct artifact *art);
62 bool history_add_artifact(struct artifact *art, bool known, bool found);
63 void history_unmask_unknown(void);
64 bool history_lose_artifact(struct artifact *art);
65 bool history_is_artifact_known(struct artifact *art);
66 size_t history_get_list(struct history_info **list);
67 
68 #endif /* !HISTORY_H */