home · contact · privacy
More code re-styling and documentation.
[plomrogue] / src / yx_uint16.c
1 /* yx_uint16.c */
2
3 #include "yx_uint16.h"
4
5 extern char yx_uint16_cmp(struct yx_uint16 a, struct yx_uint16 b)
6 {
7     if (a.y == b.y && a.x == b.x)
8         return 1;
9     else
10         return 0;
11 }
12
13 extern struct yx_uint16 mv_yx_in_dir(enum dir d, struct yx_uint16 yx)
14 {
15     if      (d == NORTH)
16         yx.y--;
17     else if (d == EAST)
18         yx.x++;
19     else if (d == SOUTH)
20         yx.y++;
21     else if (d == WEST)
22         yx.x--;
23     return yx;
24 }