home · contact · privacy
Make grids hexagonal, remove all diagonal movement penalty hassle.
[plomrogue] / src / server / yx_uint8.h
1 /* src/server/yx_uint8.h
2  *
3  * Routines for comparison and movement with yx_uint8 structs.
4  */
5
6 #ifndef YX_UINT8_H_SERVER
7 #define YX_UINT8_H_SERVER
8
9 #include <stdint.h> /* uint8_t */
10 #include "../common/yx_uint8.h" /* yx_uint8 struct */
11
12
13
14 /* Return 1 if two yx_uint8 coordinates at "a" and "b" are equal, else 0. */
15 extern uint8_t yx_uint8_cmp(struct yx_uint8 * a, struct yx_uint8 * b);
16
17 /* Return yx_uint8 coordinate one step from "yx" in direction "dir" ('e':
18  * northeast, 'd': east, 'c': south-east, 'x': south-west, 's': west, ' 'w':
19  * north-west). If "dir" is invalid or would wrap the move around the edge of a
20  * 2^8x2^8 cells field, "yx" remains unchanged.
21  */
22 extern struct yx_uint8 mv_yx_in_dir(char dir, struct yx_uint8 yx);
23
24
25
26 #endif