minior changes

This commit is contained in:
Neeflix
2018-05-31 17:53:40 +02:00
parent 01b0d990f3
commit ed83469dc3
2 changed files with 11 additions and 10 deletions

View File

@@ -12,8 +12,9 @@
#ifndef INPUTEVENTHANDLER_H_
#define INPUTEVENTHANDLER_H_
#include "InputDriver.h"
#include "InputDriver.hpp"
#include "Event.hpp"
#include "Detector.h"
namespace Input
{
@@ -21,22 +22,22 @@ namespace Input
class EventHandler
{
public:
EventHandler(std::shared_ptr<Detector> detector) :
detector(detector)
EventHandler(std::shared_ptr<InputDriver> input_driver) :
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->detector = NULL;
this->input_driver->unregister_event_handler(this);
this->input_driver = NULL;
}
virtual void handle(InputEvent& event);
virtual void handle(Event& event);
private:
std::shared_ptr<Detector> detector;
std::shared_ptr<InputDriver> input_driver;
};
}

View File

@@ -8,7 +8,7 @@
#ifndef SRC_INPUT_INPUTDRIVER_HPP_
#define SRC_INPUT_INPUTDRIVER_HPP_
#include "EventHandler.h"
#include "EventHandler.hpp"
namespace Input
{