Debian Codegraph @

TetrisAttack/src/CTetrisGame.h

raw ◀ ▶
1 Debian patch touch this file
1 #ifndef _CTETRISGAME_
2 #define _CTETRISGAME_
3
4 #include "oodle.h"
5 #include "CPlayingField.h"
6 #include "CTetrisTheme.h"
7 #include "CBlockSet.h"
8
9 class CTetrisGame : public CSDLGame
10 {
11 public:
12 CTetrisGame(int screenX, int screenY, int bitDepth, bool fullscreen, CTetrisTheme *theme, const list<CVector> &fieldOffsets);
13 CTetrisGame(int screenX, int screenY, int bitDepth, bool fullscreen, const string &title = "");
14 ~CTetrisGame();
15
16 void setTheme(CTetrisTheme* t, const list<CVector> &fieldOffsets);
17 CSprite* addSprite(CVector velocity, CVector pos, const string &filename, CImgLoader::GraphicFileType fileType);
18 CSprite* addSprite(CSprite* sprite);
19 //CBlock* addBlock(
20 enum State
21 {
22 Splash,
23 Loading,
24 Win,
25 SinglePlayer,
26 SinglePlayerPuzzle,
27 TwoPlayerHumanVsHuman,
28 TwoPlayerHumanVsComp
29 };
30
31 protected:
32 bool gameLoop(bool infinite = true);
33
34 private:
35 void animateSprites();
36 void handleEvent(const SDL_Event &e);
37 void handleKeypress(const SDL_KeyboardEvent &e);
38 void handleMouseMotion(const SDL_MouseMotionEvent &e);
39 void handleMouseButton(const SDL_MouseButtonEvent &e);
•40 void startGame();
41
42 vector<CPlayingField*> fields;
43 list<CSprite*> sprites;
44 CTetrisTheme* theme;
45 // /CSoundSystem sound;
46 CSurface *splash;
47 State state;
48 bool done;
49 CVector mouseloc;
50 };
51
52 #endif