Tinman  1.0
human.h
Go to the documentation of this file.
1 // Copyright (C) 2014 ISAAC LACOBA MOLINA
2 // Tinman author: Isaac Lacoba Molina
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 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HUMANCONTROLLER_H
18 #define HUMANCONTROLLER_H
19 #include "controller.h"
20 #include "input.h"
21 
22 class HumanController: public Controller {
24  public:
25  typedef std::map<OIS::KeyCode,
26  std::pair<Tinman::Action, Tinman::Action>> KeyBinding;
28 
30  KeyBinding key_bindings, Car::shared car);
31  virtual ~HumanController();
32 
33  void configure();
34  void exec(Tinman::Action action);
35  void update(float delta);
36 
37 private:
38  KeyBinding key_bindings_;
39 };
40 
41 #endif
Definition: controller.h:10
virtual ~HumanController()
Definition: human.cpp:11
bool network_mode_
Definition: human.h:27
KeyBinding key_bindings_
Definition: human.h:38
void exec(Tinman::Action action)
Definition: human.cpp:35
std::map< OIS::KeyCode, std::pair< Tinman::Action, Tinman::Action > > KeyBinding
Definition: human.h:26
HumanController(EventListener::shared listener, KeyBinding key_bindings, Car::shared car)
Definition: human.cpp:4
std::shared_ptr< Car > shared
Definition: car.h:44
void update(float delta)
Definition: human.cpp:28
void configure()
Definition: human.cpp:15
EventListener::shared input_
Definition: human.h:23
std::shared_ptr< EventListener > shared
Definition: input.h:56
Definition: human.h:22