Angband
mon-list.h
Go to the documentation of this file.
1 
20 #ifndef MONSTER_LIST_H
21 #define MONSTER_LIST_H
22 
23 #include "angband.h"
24 
25 typedef enum monster_list_section_e {
30 
31 typedef struct monster_list_entry_s {
32  struct monster_race *race;
38 
39 typedef struct monster_list_s {
41  size_t entries_size;
44  bool sorted;
48 
51 void monster_list_init(void);
52 void monster_list_finalize(void);
56 int monster_list_standard_compare(const void *a, const void *b);
58  int (*compare)(const void *, const void *));
60 
61 #endif /* MONSTER_LIST_H */
uint16_t u16b
Definition: h-basic.h:169
Monster "race" information, including racial memories.
Definition: monster.h:263
Includes basic includes.
u16b distinct_entries
Definition: mon-list.h:42
s16b dy
Definition: mon-list.h:35
void monster_list_sort(monster_list_t *list, int(*compare)(const void *, const void *))
Sort the monster list with the given sort function.
Definition: mon-list.c:251
void monster_list_finalize(void)
Tear down the monster list module.
Definition: mon-list.c:82
struct monster_race * race
Definition: mon-list.h:32
uint8_t byte
Definition: h-basic.h:167
bool sorted
Definition: mon-list.h:44
struct monster_list_s monster_list_t
void monster_list_free(monster_list_t *list)
Free a monster list.
Definition: mon-list.c:52
monster_list_t * monster_list_shared_instance(void)
Return a common monster list instance.
Definition: mon-list.c:90
Definition: mon-list.h:39
Definition: mon-list.h:27
enum monster_list_section_e monster_list_section_t
void monster_list_reset(monster_list_t *list)
Zero out the contents of a monster list.
Definition: mon-list.c:115
size_t entries_size
Definition: mon-list.h:41
byte attr
Definition: mon-list.h:36
monster_list_section_e
Definition: mon-list.h:25
int16_t s16b
Definition: h-basic.h:170
void monster_list_init(void)
Initialize the monster list module.
Definition: mon-list.c:74
struct monster_list_entry_s monster_list_entry_t
u16b count[MONSTER_LIST_SECTION_MAX]
Definition: mon-list.h:33
s32b creation_turn
Definition: mon-list.h:43
u16b total_monsters[MONSTER_LIST_SECTION_MAX]
Definition: mon-list.h:46
u16b total_entries[MONSTER_LIST_SECTION_MAX]
Definition: mon-list.h:45
monster_list_entry_t * entries
Definition: mon-list.h:40
Definition: mon-list.h:31
void monster_list_collect(monster_list_t *list)
Collect monster information from the current cave's monster list.
Definition: mon-list.c:137
u16b asleep[MONSTER_LIST_SECTION_MAX]
Definition: mon-list.h:34
int32_t s32b
Definition: h-basic.h:173
s16b dx
Definition: mon-list.h:35
Definition: mon-list.h:26
byte monster_list_entry_line_color(const monster_list_entry_t *entry)
Return an color to display a particular list entry with.
Definition: mon-list.c:277
Definition: mon-list.h:28
int monster_list_standard_compare(const void *a, const void *b)
Standard comparison function for the monster list: sort by depth and then power.
Definition: mon-list.c:229
monster_list_t * monster_list_new(void)
Allocate a new monster list based on the size of the current cave's monster array.
Definition: mon-list.c:29