This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | NUMDIRS 6 |
Number of directions. | |
#define | NODIR -1 |
#define | NORTHEAST 0 |
#define | EAST 1 |
#define | SOUTHEAST 2 |
#define | SOUTHWEST 3 |
#define | WEST 4 |
#define | NORTHWEST 5 |
#define | DIRNAMES { "NE", "E", "SE", "SW", "W", "NW" } |
String names for the directions. | |
#define | DIRX { 0, 1, 1, 0, -1, -1 } |
Conversions from directions to x,y deltas. | |
#define | DIRY { 1, 0, -1, -1, 0, 1 } |
#define | for_all_directions(dir) for ((dir) = 0; (dir) < NUMDIRS; ++(dir)) |
Iteration over the different directions. | |
#define | for_all_directions_randomly(dir, tmp) for ((tmp) = 0, (dir) = xrandom(NUMDIRS); (tmp) < NUMDIRS; ++(tmp), (dir) = ((dir) + 1) % NUMDIRS) |
#define | left_dir(d) (((d) + 5) % NUMDIRS) |
Formulas for relative directions to the left. | |
#define | right_dir(d) (((d) + 1) % NUMDIRS) |
Formulas for relative directions to the right. | |
#define | opposite_dir(d) (((d) + 3) % NUMDIRS) |
Oposite direction. | |
#define | dir_subtract(d1, d2) (((d1) - (d2) + NUMDIRS) % NUMDIRS) |
Difference in directions. | |
#define | angle_with(d1, d2) min(((d1) - (d2) + NUMDIRS) % NUMDIRS, ((d2) - (d1) + NUMDIRS) % NUMDIRS) |
Smallest difference in directions. | |
#define | random_dir() (xrandom(NUMDIRS)) |
Generate random direction. | |
Variables | |
char * | dirnames [] |
Direction name array. | |
int | dirx [] |
X delta array. | |
int | diry [] |
The terrain model is based on hexes arranged in horizontal rows. This means that although east and west remain intact, the concepts of north and south have vanished. Unfortunately, not all hex-dependent definitions are here. Pathfinding code has some knowledge of hexes also, as does map generation and probably parts of the machine player code.
|
Smallest difference in directions. This macro looks for the smallest difference, going each way.
|
|
Difference in directions. Compute the difference between two directions, always computing relative to the first direction.
|
|
String names for the directions.
|
|
Conversions from directions to x,y deltas.
|
|
|
|
|
|
Iteration over the different directions. Iterate through all six directions, going from NORTHEAST to NORTHWEST.
|
|
|
|
Formulas for relative directions to the left.
|
|
|
|
|
|
|
|
Number of directions.
|
|
Oposite direction. Formula for generating the opposite direction to the given direction.
|
|
Generate random direction. Generates a random direction. |
|
Formulas for relative directions to the right.
|
|
|
|
|
|
|
|
Direction name array.
|
|
X delta array.
|
|
|