1 | /* |
2 | * Copyright 2006-2009 Parker Coates <coates@kde.org> |
3 | * |
4 | * This file is part of Killbots. |
5 | * |
6 | * Killbots is free software: you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation, either version 2 of the License, or |
9 | * (at your option) any later version. |
10 | * |
11 | * Killbots is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with Killbots. If not, see <http://www.gnu.org/licenses/>. |
18 | */ |
19 | |
20 | #ifndef KILLBOTS_SPRITE_H |
21 | #define KILLBOTS_SPRITE_H |
22 | |
23 | #include <KGameRenderedItem> |
24 | |
25 | namespace Killbots |
26 | { |
27 | enum SpriteType |
28 | { |
29 | NoSprite, |
30 | Junkheap, |
31 | Hero, |
32 | Robot, |
33 | Fastbot |
34 | }; |
35 | |
36 | class Sprite : public KGameRenderedItem |
37 | { |
38 | public: // types |
39 | enum |
40 | { |
41 | Type = UserType + 1 |
42 | }; |
43 | |
44 | public: // functions |
45 | explicit Sprite(); |
46 | virtual ~Sprite(); |
47 | |
48 | SpriteType spriteType() const; |
49 | void setSpriteType( SpriteType type ); |
50 | |
51 | void enqueueGridPos( QPoint position ); |
52 | QPoint currentGridPos() const; |
53 | QPoint nextGridPos() const; |
54 | QPoint gridPos() const; |
55 | void advanceGridPosQueue(); |
56 | |
57 | virtual int type() const; |
58 | |
59 | protected: |
60 | virtual void receivePixmap( const QPixmap & pixmap ); |
61 | |
62 | private: // data members |
63 | SpriteType m_type; |
64 | QList<QPoint> m_gridPositions; |
65 | }; |
66 | } |
67 | |
68 | #endif |
69 | |