Did a lot of boilerplate on the Event wrapper

This commit is contained in:
MitchellHansen
2017-01-14 01:16:03 -08:00
parent 3c91614f45
commit 4cd9bbb4ed
3 changed files with 80 additions and 0 deletions

View File

@@ -119,9 +119,15 @@ public:
event_class = Event_Class::SensorEvent;
}
else {
std::cout << "Unable to classify sf::Event into Event_Class";
abort();
}
// get the bucket containing subscribers to that Event_Class
std::vector<SfEventSubscriber*> *event_type_bucket = &subscribers[event_class];
// Send them the event
for (auto s : *event_type_bucket) {
s->update(this, e);
}