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.
24 class Field : public QWidget
43 typedef QVector<Field::FieldRect> RectVector;
45 Field (QWidget *parent, int *turns);
48 FieldSize getSize () const;
50 static int getNumRectsOfSize (FieldSize size);
51 static int getNumTurnsOfSize (FieldSize size);
54 static const int numRects[NUM_SIZES];
55 static const int numTurns[NUM_SIZES];
58 static int getRectSize (FieldSize size);
59 void tryFloodRecurse (quint8 brush, int x, int y);
60 void floodNeighbours (quint8 brush, int x, int y);
68 void mousePressEvent (QMouseEvent *event);
69 void paintEvent (QPaintEvent *event);
72 void turnsChanged (int turns);
75 void flood (int colorIndex);