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

LevelInput Class Reference

Inheritance diagram for LevelInput:

Inheritance graph
[legend]
Collaboration diagram for LevelInput:

Collaboration graph
[legend]

Detailed Description

Handle input for level.

Definition at line 13 of file LevelInput.h.

Public Member Functions

 LevelInput (Level *level)
virtual void mouseEvent (const MouseStroke &buttons)

Protected Member Functions

virtual void specKey (int keyIndex)
virtual void specStroke (const KeyStroke &stroke)


Constructor & Destructor Documentation

LevelInput::LevelInput Level level  ) 
 

Definition at line 20 of file LevelInput.cpp.

00021     : GameInput(level)
00022 {
00023     m_keymap->registerKey(KeyStroke(SDLK_SPACE, KMOD_NONE),
00024             KeyDesc(KEY_SWITCH, "switch"));
00025     m_keymap->registerKey(KeyStroke(SDLK_F2, KMOD_NONE),
00026             KeyDesc(KEY_SAVE, "save"));
00027     m_keymap->registerKey(KeyStroke(SDLK_F3, KMOD_NONE),
00028             KeyDesc(KEY_LOAD, "load"));
00029     m_keymap->registerKey(KeyStroke(SDLK_BACKSPACE, KMOD_NONE),
00030             KeyDesc(KEY_RESTART, "restart"));
00031     m_keymap->registerKey(KeyStroke(SDLK_F5, KMOD_NONE),
00032             KeyDesc(KEY_SHOW_STEPS, "show number of steps"));
00033 }


Member Function Documentation

void LevelInput::mouseEvent const MouseStroke buttons  )  [virtual]
 

Reimplemented from InputHandler.

Definition at line 80 of file LevelInput.cpp.

00081 {
00082     getLevel()->controlMouse(buttons);
00083 }

void LevelInput::specKey int  keyIndex  )  [protected, virtual]
 

Reimplemented from StateInput.

Definition at line 42 of file LevelInput.cpp.

00043 {
00044     switch (keyIndex) {
00045         case KEY_SWITCH:
00046             if (!getLevel()->isShowing() && !getLevel()->isLoading()) {
00047                 getLevel()->switchFish();
00048             }
00049             break;
00050         case KEY_SAVE:
00051             if (!getLevel()->isShowing() && !getLevel()->isLoading()) {
00052                 getLevel()->action_save();
00053             }
00054             break;
00055         case KEY_LOAD:
00056             getLevel()->interruptShow();
00057             getLevel()->action_load();
00058             break;
00059         case KEY_RESTART:
00060             getLevel()->interruptShow();
00061             getLevel()->action_restart();
00062             break;
00063         case KEY_SHOW_STEPS:
00064             toggleParam("show_steps");
00065             break;
00066         default:
00067             GameInput::specKey(keyIndex);
00068     }
00069 }

void LevelInput::specStroke const KeyStroke stroke  )  [protected, virtual]
 

Reimplemented from StateInput.

Definition at line 72 of file LevelInput.cpp.

00073 {
00074     if (!getLevel()->isShowing() && !getLevel()->isLoading()) {
00075         getLevel()->controlEvent(stroke);
00076     }
00077 }


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