minior changes
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef SRC_INPUT_INPUTDRIVER_HPP_
|
||||
#define SRC_INPUT_INPUTDRIVER_HPP_
|
||||
|
||||
#include "EventHandler.h"
|
||||
#include "EventHandler.hpp"
|
||||
namespace Input
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user