HoverRace  2.0
InputPeer.h
Go to the documentation of this file.
1 
2 // InputPeer.h
3 //
4 // Copyright (c) 2014-2016 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include "../../../engine/Script/Handlers.h"
25 #include "../../../engine/Script/Peer.h"
26 
27 namespace HoverRace {
28  namespace Control {
29  class InputEventController;
30  }
31  namespace Script {
32  class Core;
33  }
34 }
35 
36 
37 namespace HoverRace {
38 namespace Client {
39 namespace HoverScript {
40 
45 class InputPeer : public Script::Peer
46 {
48 
49 public:
50  InputPeer(Script::Core &scripting,
51  Control::InputEventController &controller);
52  virtual ~InputPeer() { }
53 
54 public:
55  static void Register(Script::Core &scripting);
56 
57 public:
58  void LHotkey(const std::string &key, const luabind::object &fn);
59 
60 private:
62  std::vector<Script::Handlers> hotkeyHandlers;
63  std::vector<std::unique_ptr<boost::signals2::scoped_connection>> hotkeyConns;
64 };
65 
66 } // namespace HoverScript
67 } // namespace Client
68 } // namespace HoverRace
Control::InputEventController & controller
Definition: InputPeer.h:61
virtual ~InputPeer()
Definition: InputPeer.h:52
Base class for script peers.
Definition: Peer.h:47
Scripting peer for input.
Definition: InputPeer.h:45
std::vector< std::unique_ptr< boost::signals2::scoped_connection > > hotkeyConns
Definition: InputPeer.h:63
Definition: Announcement.h:24
std::vector< Script::Handlers > hotkeyHandlers
Definition: InputPeer.h:62
Translates input events into actions.
Definition: Controller.h:106
A script environment.
Definition: Core.h:66