7 const int FIELD_WIDTH=10;
8 const int FIELD_HEIGHT=8;
10 const int CELL_EMPTY=0;
11 const int CELL_WALL=1;
13 const int MAX_UNDO=10;
16 typedef int Field[PF::FIELD_WIDTH][PF::FIELD_HEIGHT];
18 class PlayField : public QObject
23 Field undos[PF::MAX_UNDO];
24 int undoMade[PF::MAX_UNDO];
27 bool moveBlock(int w, int h, int dw, int dh);
28 bool checkFall(int w, int h);
29 bool checkGlobalFall();
32 void copy(const Field field_src, Field field_dst)
34 for(int w=0; w<PF::FIELD_WIDTH; w++)
35 for(int h=0; h<PF::FIELD_HEIGHT; h++)
36 field_dst[w][h]=field_src[w][h];
38 void setup(const Field field_src)
40 copy(field_src, field);
49 PlayField(const QString &_title, const QString &_board, const QString &_solution);
50 PlayField(PlayField *pf):title(pf->title),solution(pf->solution)
58 void set(int w, int h, int cell){field[w][h]=cell;}
59 int get(int w, int h){return field[w][h];}
61 const QString& getSolution()
65 void move(int w, int h, int w_new);
69 void cellMoved(int w, int h, int wnew, int hnew);
70 void cellGone(int w, int h);