author | Wuzzy <Wuzzy2@mail.ru> |
Wed, 04 Apr 2018 19:33:19 +0200 | |
changeset 13314 | 2bdae461ae5f |
parent 10108 | c68cf030eded |
permissions | -rw-r--r-- |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
6700 | 3 |
* Copyright (c) 2006-2012 Igor Ulyanov <iulyanov@gmail.com> |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
4 |
* |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
7 |
* the Free Software Foundation; version 2 of the License |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
8 |
* |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
13 |
* |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
6969
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
17 |
*/ |
2377 | 18 |
|
1455 | 19 |
#include <QFrame> |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
20 |
#include <QImage> |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
21 |
|
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
22 |
#ifndef _ITEM_NUM_INCLUDED |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
23 |
#define _ITEM_NUM_INCLUDED |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
24 |
|
1455 | 25 |
class ItemNum : public QFrame |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
26 |
{ |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
27 |
Q_OBJECT |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
28 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
29 |
public: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
30 |
void setInfinityState(bool value); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
31 |
void setEnabled(bool value); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
32 |
unsigned char getItemsNum() const; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
33 |
void setItemsNum(const unsigned char num); |
640 | 34 |
|
6969
3273a2b983ca
made the hog count thingy prettier when on low space... have fun squishing hogs!
sheepluva
parents:
6700
diff
changeset
|
35 |
protected: |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
36 |
QImage m_im; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
37 |
QImage m_img; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
38 |
bool infinityState; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
39 |
bool enabled; |
1904 | 40 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
41 |
ItemNum(const QImage& im, const QImage& img, QWidget * parent, unsigned char min=2, unsigned char max=8); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
42 |
virtual QSize sizeHint () const; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
43 |
virtual ~ItemNum()=0; |
1904 | 44 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
45 |
bool nonInteractive; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
46 |
unsigned char minItems; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
47 |
unsigned char maxItems; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
48 |
unsigned char numItems; |
624 | 49 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
50 |
// from QWidget |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
51 |
virtual void mousePressEvent ( QMouseEvent * event ); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
52 |
virtual void wheelEvent ( QWheelEvent * event ); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
53 |
virtual void paintEvent(QPaintEvent* event); |
1904 | 54 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
55 |
// to be implemented in child |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
56 |
virtual void incItems()=0; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6153
diff
changeset
|
57 |
virtual void decItems()=0; |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
58 |
}; |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
59 |
|
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
diff
changeset
|
60 |
#endif // _ITEM_NUM_INCLUDED |