obscurelyme / CoffeeMaker

A warm and fuzzy 2D Game Engine
GNU Lesser General Public License v2.1
7 stars 0 forks source link

Feature/refactor events #46

Closed obscurelyme closed 3 years ago

obscurelyme commented 3 years ago

This PR completes a major overhaul of how UserEvents are processed in the game engine

Rather than doing anything "fancy". CoffeeMaker has a special interface IUserEventListener that any class may implement. The only function that's needed to implement is OnSDLUserEvent. The class need only implement that one method and it will automatically be called each frame when an SDL_UserEvent is in the stack. Upon destruction of the class, it will be removed from the list of listeners.