1 #ifndef __board_h 2 #define __board_h 3 4 class Field { 5 public: reset(int id)6 void reset( int id ) 7 { tile_id = id; lock_col = 0; locked=0; found=0; flash=0; gone=0; } 8 9 int tile_id; // tile-index, used twice per board of course 10 unsigned lock_col : 4; // color_id 11 unsigned locked : 1; // geoeffnet 12 unsigned found : 1; // Treffer 13 unsigned flash : 1; // Highligh beim Blinken 14 unsigned gone : 1; // auf Stapel gelegt 15 }; 16 17 18 class Board { 19 public: 20 Board( int width, int height ); 21 ~Board(); 22 23 int check_swap( int op, int np ); 24 void reset(); 25 void color_removed(int color_id); 26 int tile_removed(int color_id); 27 Field *field( int x, int y ); 28 Field *field( int fid ); 29 30 int ntiles; 31 int tiles_left; 32 unsigned long finished; 33 int dx, dy; // dimension of board 34 Field *f; 35 }; 36 37 #endif 38