Harmonic Flow Framework (libhffwk)
Cross platform C++ 2D Game Engine Framework
Controller.cpp
1 /*
2  Harmonic Flow Framework
3  Copyright (C) 2011-2018 Andreas Widen <andreas@harmonicflow.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 #include "Controller.h"
22 
23 using namespace HFCore;
24 
25 #include "debug/CrtDbgNew.h"
26 
28 {
29  mIsEnabled = true;
30  mIsConnected = false;
31 }
32 
34 {
35 }
36 
37 void Controller::setConnected(bool connected)
38 {
39  mIsConnected = connected;
40 }
41 
43 {
44  return mIsConnected;
45 }
46 
47 void Controller::setEnabled(bool enabled)
48 {
49  mIsEnabled = enabled;
50 }
51 
53 {
54  return mIsEnabled && mIsConnected;
55 }
virtual void setEnabled(bool enabled)
Set controller enabled or disabled.
Definition: Controller.cpp:47
virtual ~Controller()
Destructor.
Definition: Controller.cpp:33
virtual bool isEnabled()
Check whether controller is enabled.
Definition: Controller.cpp:52
Definition: Actor.h:34
Controller is a base class for Keyboard, Mouse, Touch and GamePad.
virtual bool isConnected()
Check whether controller is connected.
Definition: Controller.cpp:42
virtual void setConnected(bool connected)
Set controller connected or disconnected.
Definition: Controller.cpp:37
Controller()
Constructor.
Definition: Controller.cpp:27