minior changes
This commit is contained in:
@@ -12,8 +12,9 @@
|
|||||||
#ifndef INPUTEVENTHANDLER_H_
|
#ifndef INPUTEVENTHANDLER_H_
|
||||||
#define INPUTEVENTHANDLER_H_
|
#define INPUTEVENTHANDLER_H_
|
||||||
|
|
||||||
#include "InputDriver.h"
|
#include "InputDriver.hpp"
|
||||||
#include "Event.hpp"
|
#include "Event.hpp"
|
||||||
|
#include "Detector.h"
|
||||||
|
|
||||||
namespace Input
|
namespace Input
|
||||||
{
|
{
|
||||||
@@ -21,22 +22,22 @@ namespace Input
|
|||||||
class EventHandler
|
class EventHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EventHandler(std::shared_ptr<Detector> detector) :
|
EventHandler(std::shared_ptr<InputDriver> input_driver) :
|
||||||
detector(detector)
|
input_driver(input_driver)
|
||||||
{
|
{
|
||||||
this->detector->register_event_handler(this);
|
this->input_driver->register_event_handler(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~InputEventHandler()
|
virtual ~EventHandler()
|
||||||
{
|
{
|
||||||
this->detector->unregister_event_handler(this);
|
this->input_driver->unregister_event_handler(this);
|
||||||
this->detector = NULL;
|
this->input_driver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void handle(InputEvent& event);
|
virtual void handle(Event& event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<Detector> detector;
|
std::shared_ptr<InputDriver> input_driver;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#ifndef SRC_INPUT_INPUTDRIVER_HPP_
|
#ifndef SRC_INPUT_INPUTDRIVER_HPP_
|
||||||
#define SRC_INPUT_INPUTDRIVER_HPP_
|
#define SRC_INPUT_INPUTDRIVER_HPP_
|
||||||
|
|
||||||
#include "EventHandler.h"
|
#include "EventHandler.hpp"
|
||||||
namespace Input
|
namespace Input
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user