Angband
z-type.h
Go to the documentation of this file.
1 
19 #ifndef INCLUDED_ZTYPE_H
20 #define INCLUDED_ZTYPE_H
21 
22 #include "h-basic.h"
23 
24 struct loc {
25  int x;
26  int y;
27 };
28 
29 struct loc loc(int x, int y);
30 bool loc_eq(struct loc grid1, struct loc grid2);
31 void loc_set_eq(struct loc *dest, struct loc source);
32 
33 
37 typedef struct grouper grouper;
38 struct grouper {
39  int tval;
40  const char *name;
41 };
42 
46 struct point_set {
47  int n;
48  int allocated;
49  struct loc *pts;
50 };
51 
52 struct point_set *point_set_new(int initial_size);
53 void point_set_dispose(struct point_set *ps);
54 void add_to_point_set(struct point_set *ps, int y, int x);
55 int point_set_size(struct point_set *ps);
56 int point_set_contains(struct point_set *ps, int y, int x);
57 
58 #endif /* !INCLUDED_ZTYPE_H */
int n
Definition: z-type.h:47
Definition: z-type.h:24
void point_set_dispose(struct point_set *ps)
Definition: z-type.c:58
typedef int
Definition: libpng12/png.h:1135
struct point_set * point_set_new(int initial_size)
Utility functions to work with point_sets.
Definition: z-type.c:49
A set of points that can be constructed to apply a set of changes to.
Definition: z-type.h:46
int x
Definition: z-type.h:25
The lowest level header.
const char * name
Definition: z-type.h:40
struct loc * pts
Definition: z-type.h:49
bool loc_eq(struct loc grid1, struct loc grid2)
Determine if two grid locations are equal.
Definition: z-type.c:32
int y
Definition: z-type.h:26
int point_set_contains(struct point_set *ps, int y, int x)
Definition: z-type.c:84
Definition: z-type.h:38
void loc_set_eq(struct loc *dest, struct loc source)
Set one grid location equal to another.
Definition: z-type.c:40
int allocated
Definition: z-type.h:48
int point_set_size(struct point_set *ps)
Definition: z-type.c:79
void add_to_point_set(struct point_set *ps, int y, int x)
Add the point to the given point set, making more space if there is no more space left...
Definition: z-type.c:68
int tval
Definition: z-type.h:39
Definition: source.h:7