public
Description: Multi-player, turn-based games library.
Homepage: http://vying.org
Clone URL: git://github.com/eki/vying.git
vying / ext / vying / c / parts / board / board.h
100644 98 lines (60 sloc) 2.332 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* Copyright 2007, Eric Idema except where otherwise noted.
* You may redistribute / modify this file under the same terms as Ruby.
*/
 
#include "ruby.h"
 
/* Classes and Modules */
 
VALUE Board;
VALUE Coord;
VALUE Coords;
VALUE CoordsProxy;
VALUE Plugins;
VALUE Frontier;
VALUE CustodialCapture;
 
 
/* Board prototypes */
 
VALUE board_subscript( int argc, VALUE *argv, VALUE self );
VALUE board_subscript_assign( int argc, VALUE *argv, VALUE self );
 
VALUE board_in_bounds( VALUE self, VALUE x, VALUE y );
 
VALUE board_get( VALUE self, VALUE x, VALUE y );
VALUE board_set( VALUE self, VALUE x, VALUE y, VALUE p );
 
VALUE board_get_coord( VALUE self, VALUE c );
VALUE board_set_coord( VALUE self, VALUE c, VALUE p );
 
VALUE board_occupy( VALUE self, VALUE x, VALUE y, VALUE p );
VALUE board_unoccupy( VALUE self, VALUE x, VALUE y, VALUE p );
 
VALUE board_ci( VALUE self, VALUE x, VALUE y );
 
VALUE board_neighbors( VALUE self, int x, int y );
 
 
/* Coord prototypes */
 
VALUE coord_class_subscript( int argc, VALUE *argv, VALUE self );
VALUE coord_addition( VALUE self, VALUE obj );
VALUE coord_direction_to( VALUE self, VALUE obj );
 
/* Coords prototypes */
 
VALUE coords_include( VALUE self, VALUE c );
VALUE coords_next( VALUE self, VALUE c, VALUE d );
 
/* CoordsProxy prototypes */
 
VALUE coords_proxy_connected( VALUE self, VALUE cs );
 
 
/* Frontier prototypes */
 
VALUE frontier_update( VALUE self, VALUE c );
 
 
/* CustodialCapture prototypes */
 
VALUE custodial_capture_valid( int argc, VALUE *argv, VALUE self );
VALUE custodial( int argc, VALUE *argv, VALUE self );
 
 
/* IDs */
 
ID id_dup, id_x, id_y, id_subscript, id_subscript_assign, id_new,
   id_hash, id_include, id_n, id_s, id_w, id_e, id_se, id_nw, id_sw, id_ne,
   id_DIRECTIONS, id_directions, id_white, id_black, id_delete, id_uniq_ex,
   id_to_s, id_set, id_before_set, id_after_set, id_first, id_last,
   id_resize_q, id_resize, id_neighbors;
 
 
/* SYMs */
 
VALUE sym_black, sym_white,
      sym_n, sym_s, sym_w, sym_e, sym_se, sym_nw, sym_sw, sym_ne;
 
/* Ruby 1.9 and 1.8 compatibility */
 
#ifndef RSTRING_PTR
#define RSTRING_PTR(x) (RSTRING(x)->ptr)
#endif
 
#ifndef RSTRING_LEN
#define RSTRING_LEN(x) (RSTRING(x)->len)
#endif
 
#ifndef RARRAY_PTR
#define RARRAY_PTR(x) (RARRAY(x)->ptr)
#endif
 
#ifndef RARRAY_LEN
#define RARRAY_LEN(x) (RARRAY(x)->len)
#endif