#ifndef _DIGDUNGEON_H_7678786b_ #define _DIGDUNGEON_H_7678786b_ /* * APIs exported by digdungeon.c. These are, of course, things related * to digging the dungeon. */ #include "structs.h" /* * A location to avoid in ckavoid(). See it for more. */ extern LOC *avoidloc; /* * Dig out a cell, given the level it's on and its coordinates. The * cell must not be one of the border cells (WRAPAROUND levels have no * border cells). This also handles converting any ROCKs adjacent to * the newly-dug cell to WALLs. */ extern void digcell(LEVEL *, int, int); /* * Clear a level. This sets all LOCs on the level to have the type * passed as a second argument, which must be LOC_ROCK or LOC_CAVE; if * LOC_CAVE, the cavetype is set to LOC_JUSTCAVE. All cells also have * their flags and inventory cleared and are set to have no monster. * The link-to link (for gates and stairs) is also cleared and the * on-level backpointers set to point to the level. */ extern void clearlevel(LEVEL *, LOCTYPE); /* * Given a rectangle described as a size-and-position (size sx,sy and * position px,py) on a level l, solidrock(l,sx,sy,px,py) returns true * iff all cells in the rectangle are of type LOC_ROCK. */ extern int solidrock(LEVEL *, int, int, int, int); /* * Clears out certain things for the whole dungeon. For every level, * this initializes the level's monster count to 0 and its cave-cell * count to the actual LOC_CAVE cell count. It also sets the subtype * of any walls and secret doors to "wall of unknown orientation" and * clears all non-permanent flag bits on each LOC. */ extern void cleardungeon(void); /* * Top-level routine for digging the dungeon. This sets up all levels * and digs the dungeon. It does not populate the dungeon with * anything (neither monsters nor objects), just the permanent * features like stairs, doors, and gates. */ extern void digdungeon(void); /* * Location test function which returns true for any CAVE/JUSCTAVE cell * that is at least 20 away in the L1 (city-block) metric from * avoidloc. */ extern int ckavoid(LOC *); /* * Find a random location on a level satisfying a predicate. See the * full description in the comment in digspecial.c. */ extern LOC *randomloc(LEVEL *, int (*)(LOC *), int); /* * Do something for all immediate neighbours of a location, that is, * for a 3x3 square centred on the location. */ extern void all_neighbours(LOC *, void (*)(LOC *)); #endif