Monster list iterator

Add some basic functions to iterate through the monster list,
ignoring dead monsters. Mainly just to allow splitting up code
into discrete functions.

Not quite happy with the get_iter_mons_xy - should probably have
a pointer to iterator data struct, which gets passed through instead,
but this works for now.
This commit is contained in:
Pasi Kallinen
2022-04-24 13:03:43 +03:00
parent f886e0d6ce
commit 4a01c8fbd7
10 changed files with 418 additions and 309 deletions

View File

@@ -1537,7 +1537,10 @@ extern void wakeup(struct monst *, boolean);
extern void wake_nearby(void);
extern void wake_nearto(int, int, int);
extern void seemimic(struct monst *);
extern void normal_shape(struct monst *mon);
extern void normal_shape(struct monst *);
extern void iter_mons(void (*)(struct monst *));
extern struct monst *get_iter_mons(boolean (*)(struct monst *));
extern struct monst *get_iter_mons_xy(boolean (*)(struct monst *, xchar, xchar), xchar, xchar);
extern void rescham(void);
extern void restartcham(void);
extern void restore_cham(struct monst *);