Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

Pedometer Class Reference

Inheritance diagram for Pedometer:

Inheritance graph
[legend]
Collaboration diagram for Pedometer:

Collaboration graph
[legend]

Detailed Description

Pedometer with tree buttons.

Definition at line 18 of file Pedometer.h.

Public Member Functions

 Pedometer (LevelStatus *status, Level *level)
virtual ~Pedometer ()
virtual const char * getName () const
void runSelected ()
 Start selected button.
virtual void drawOn (SDL_Surface *screen)
void receiveString (const StringMsg *msg)
 Handle incoming message.

Protected Member Functions

virtual void own_initState ()
 Display menu and play menu music.
virtual void own_updateState ()
virtual void own_pauseState ()
virtual void own_resumeState ()
virtual void own_cleanState ()


Constructor & Destructor Documentation

Pedometer::Pedometer LevelStatus status,
Level level
 

Definition at line 26 of file Pedometer.cpp.

00027 {
00028     m_level = new_level;
00029     m_status = status;
00030     m_solution = m_status->readSolvedMoves();
00031     m_meterPhase = 0;
00032     m_bg = NULL;
00033 
00034     prepareBg();
00035     prepareRack();
00036 
00037     m_numbers = ResImagePack::loadImage(
00038             Path::dataReadPath("images/menu/numbers.png"));
00039 
00040     takeHandler(new PedoInput(this));
00041     registerDrawable(m_bg);
00042     registerDrawable(m_rack);
00043     registerDrawable(this);
00044 }

Pedometer::~Pedometer  )  [virtual]
 

Definition at line 46 of file Pedometer.cpp.

00047 {
00048     if (m_level) {
00049         delete m_level;
00050     }
00051     SDL_FreeSurface(m_numbers);
00052     delete m_rack;
00053     delete m_bg;
00054 }


Member Function Documentation

void Pedometer::drawOn SDL_Surface *  screen  )  [virtual]
 

Implements Drawable.

Definition at line 181 of file Pedometer.cpp.

00182 {
00183     drawNumbers(screen, m_solution.size());
00184 }

virtual const char* Pedometer::getName  )  const [inline, virtual]
 

Implements INamed.

Definition at line 50 of file Pedometer.h.

00050 { return "state_pedometer"; };

virtual void Pedometer::own_cleanState  )  [inline, protected, virtual]
 

Implements GameState.

Definition at line 46 of file Pedometer.h.

00046 {}

void Pedometer::own_initState  )  [protected, virtual]
 

Display menu and play menu music.

Implements GameState.

Definition at line 107 of file Pedometer.cpp.

00108 {
00109     registerWatcher("lang");
00110     own_resumeState();
00111 }

virtual void Pedometer::own_pauseState  )  [inline, protected, virtual]
 

Implements GameState.

Definition at line 44 of file Pedometer.h.

00044 {}

virtual void Pedometer::own_resumeState  )  [inline, protected, virtual]
 

Implements GameState.

Definition at line 45 of file Pedometer.h.

00045 {}

void Pedometer::own_updateState  )  [protected, virtual]
 

Implements GameState.

Definition at line 114 of file Pedometer.cpp.

00115 {
00116     watchCursor();
00117 }

void Pedometer::receiveString const StringMsg msg  )  [virtual]
 

Handle incoming message.

Messages:

  • param_changed(lang) ... refresh bg

Exceptions:
UnknownMsgException 

Reimplemented from BaseListener.

Definition at line 237 of file Pedometer.cpp.

00238 {
00239     if (msg->equalsName("param_changed")) {
00240         std::string param = msg->getValue();
00241         if ("lang" == param) {
00242             prepareBg();
00243         }
00244         else {
00245             throw UnknownMsgException(msg);
00246         }
00247     }
00248     else {
00249         throw UnknownMsgException(msg);
00250     }
00251 }

void Pedometer::runSelected  ) 
 

Start selected button.

Definition at line 143 of file Pedometer.cpp.

00144 {
00145     if (m_activeMask == m_maskRun) {
00146         runLevel();
00147     }
00148     else if (m_activeMask == m_maskReplay) {
00149         runReplay();
00150     }
00151     else {
00152         quitState();
00153     }
00154 }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:56:12 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2