home · contact · privacy
Added command to focus map on player.
[plomrogue] / src / yx_uint16.c
1 #include "yx_uint16.h"
2
3 extern char yx_uint16_cmp (struct yx_uint16 a, struct yx_uint16 b) {
4 // Compare two coordinates of type yx_uint16.
5   if (a.y == b.y && a.x == b.x) return 1;
6   else                          return 0; }
7
8 extern struct yx_uint16 mv_yx_in_dir (char d, struct yx_uint16 yx) {
9 // Return yx coordinates one step to the direction d of yx.
10   if      (d == NORTH) yx.y--;
11   else if (d == EAST)  yx.x++;
12   else if (d == SOUTH) yx.y++;
13   else if (d == WEST)  yx.x--;
14   return yx; }
15