| 1 |
#ifndef HEADER_PEDOMETER_H |
| 2 |
#define HEADER_PEDOMETER_H |
| 3 |
|
| 4 |
class Level; |
| 5 |
class LevelStatus; |
| 6 |
class LayeredPicture; |
| 7 |
class Picture; |
| 8 |
|
| 9 |
#include "Drawable.h" |
| 10 |
#include "GameState.h" |
| 11 |
|
| 12 |
#include "SDL.h" |
| 13 |
#include <string> |
| 14 |
|
| 15 |
/** |
| 16 |
* Pedometer with tree buttons. |
| 17 |
*/ |
| 18 |
class Pedometer : public GameState, public Drawable { |
| 19 |
private: |
| 20 |
Picture *m_bg; |
| 21 |
LayeredPicture *m_rack; |
| 22 |
SDL_Surface *m_numbers; |
| 23 |
LevelStatus *m_status; |
| 24 |
Level *m_level; |
| 25 |
Uint32 m_activeMask; |
| 26 |
Uint32 m_maskRun; |
| 27 |
Uint32 m_maskReplay; |
| 28 |
Uint32 m_maskCancel; |
| 29 |
std::string m_solution; |
| 30 |
int m_meterPhase; |
| 31 |
private: |
| 32 |
void prepareBg(); |
| 33 |
void prepareRack(); |
| 34 |
|
| 35 |
void watchCursor(); |
| 36 |
void runLevel(); |
| 37 |
void runReplay(); |
| 38 |
|
| 39 |
void drawNumbers(SDL_Surface *screen, int value); |
| 40 |
void drawNumber(SDL_Surface *screen, int x, int y, int shiftY); |
| 41 |
protected: |
| 42 |
virtual void own_initState(); |
| 43 |
virtual void own_updateState(); |
| 44 |
virtual void own_pauseState() {} |
| 45 |
virtual void own_resumeState() {} |
| 46 |
virtual void own_cleanState() {} |
| 47 |
public: |
| 48 |
Pedometer(LevelStatus *status, Level *level); |
| 49 |
virtual ~Pedometer(); |
| 50 |
virtual const char *getName() const { return "state_pedometer"; }; |
| 51 |
|
| 52 |
void runSelected(); |
| 53 |
virtual void drawOn(SDL_Surface *screen); |
| 54 |
void receiveString(const StringMsg *msg); |
| 55 |
}; |
| 56 |
|
| 57 |
#endif |