| 1 |
/* |
| 2 |
* Copyright (C) 2004 Ivo Danihelka ([email protected]) |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation; either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
*/ |
| 9 |
#include "PedoInput.h" |
| 10 |
|
| 11 |
#include "Pedometer.h" |
| 12 |
#include "Keymap.h" |
| 13 |
|
| 14 |
#include "KeyStroke.h" |
| 15 |
#include "MouseStroke.h" |
| 16 |
|
| 17 |
//----------------------------------------------------------------- |
| 18 |
PedoInput::PedoInput(Pedometer *pedometer) |
| 19 |
: GameInput(pedometer) |
| 20 |
{ |
| 21 |
} |
| 22 |
//----------------------------------------------------------------- |
| 23 |
Pedometer * |
| 24 |
PedoInput::getPedo() |
| 25 |
{ |
| 26 |
return dynamic_cast<Pedometer*>(m_state); |
| 27 |
} |
| 28 |
//----------------------------------------------------------------- |
| 29 |
void |
| 30 |
PedoInput::mouseEvent(const MouseStroke &buttons) |
| 31 |
{ |
| 32 |
if (buttons.isLeft()) { |
| 33 |
getPedo()->runSelected(); |
| 34 |
} |
| 35 |
} |
| 36 |
|