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

WorldInput.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net)
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  */
00009 #include "WorldInput.h"
00010 
00011 #include "WorldMap.h"
00012 #include "Keymap.h"
00013 
00014 #include "KeyStroke.h"
00015 #include "MouseStroke.h"
00016 
00017 //-----------------------------------------------------------------
00018 WorldInput::WorldInput(WorldMap *world)
00019     : GameInput(world)
00020 {
00021     //TODO: 'O' ... options, 'I' ... intro, 'E' ... exit, 'C' ... credits
00022 }
00023 //-----------------------------------------------------------------
00024 WorldMap *
00025 WorldInput::getWorld()
00026 {
00027     return dynamic_cast<WorldMap*>(m_state);
00028 }
00029 //-----------------------------------------------------------------
00030 void
00031 WorldInput::mouseEvent(const MouseStroke &buttons)
00032 {
00033     if (buttons.isLeft()) {
00034         getWorld()->runSelected();
00035     }
00036 }
00037 

Generated on Wed Jun 1 09:54:32 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2