1 /* src/server/yx_uint8.h
3 * Routines for comparison and movement with yx_uint8 structs.
6 #ifndef YX_UINT8_H_SERVER
7 #define YX_UINT8_H_SERVER
9 #include <stdint.h> /* uint8_t */
14 /* Move "yx" into hex direction "d". If this moves "yx" beyond the minimal (0)
15 * or maximal (UINT8_MAX) column or row, it wraps to the opposite side. Such
16 * wrapping is returned as a wraps enum value and stored, so that further calls
17 * to move "yx" back into the opposite direction may unwrap it again. Pass an
18 * "unwrap" of !0 to re-set the internal wrap memory to 0.
19 * Hex direction values for "d": 'e' (north-east), 'd' (east), 'c' (south-east),
20 * 'x' (south-west), 's' (west), 'w' (north-west)
22 extern uint8_t mv_yx_in_dir_wrap(char d, struct yx_uint8 * yx, uint8_t unwrap);