2 Copyright 2010 Serge Ziryukin <ftrvxmtrx@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
23 class Field : public QWidget
36 Field (QWidget *parent, const QVector<QBrush> &brushes, FieldSize size);
37 Field (QWidget *parent);
40 FieldSize getSize () const;
43 static int getNumRectsOfSize (FieldSize size);
44 static int getNumTurnsOfSize (FieldSize size);
53 static const int rects[NUM_SIZES];
54 static const int turns[NUM_SIZES];
56 void init (const QVector<QBrush> &brushes, FieldSize size);
57 static int getRectSize (FieldSize size);
60 QVector<QBrush> brushes;
61 QVector<FieldRect> data;
64 void paintEvent (QPaintEvent *event);