Events are now passing correctly, small bug with held keys that needs fixing
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <iostream>
|
||||
#include "Event.hpp"
|
||||
#include <memory>
|
||||
|
||||
|
||||
class VrEventPublisher;
|
||||
@@ -9,9 +10,9 @@ class VrEventPublisher;
|
||||
class VrEventSubscriber {
|
||||
public:
|
||||
virtual ~VrEventSubscriber() {};
|
||||
virtual void update(VrEventPublisher* p, vr::Event e) = 0;
|
||||
void subscribe(VrEventPublisher* publisher, vr::Event::EventType type);
|
||||
void subscribe(VrEventPublisher* publisher, std::vector<vr::Event::EventType> type);
|
||||
virtual void recieve_event(VrEventPublisher* publisher, std::unique_ptr<vr::Event> event) = 0;
|
||||
void subscribe_to_publisher(VrEventPublisher* publisher, vr::Event::EventType type);
|
||||
void subscribe_to_publisher(VrEventPublisher* publisher, std::vector<vr::Event::EventType> type);
|
||||
protected:
|
||||
std::vector<vr::Event::EventType> subscribed_event_types;
|
||||
};
|
||||
@@ -24,7 +25,7 @@ public:
|
||||
virtual void subscribe(VrEventSubscriber *subscriber, vr::Event::EventType type);
|
||||
virtual void subscribe(VrEventSubscriber *subscriber, std::vector<vr::Event::EventType> type);
|
||||
virtual void unsubscribe(VrEventSubscriber *s, vr::Event::EventType c);
|
||||
virtual void notify(vr::Event e);
|
||||
virtual void notify_subscribers(std::unique_ptr<vr::Event> event);
|
||||
private:
|
||||
std::map<vr::Event::EventType, std::vector<VrEventSubscriber*>> subscribers;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user