EventLoop
-
class EventLoop
Event loops store user-defined bindings to be run every frame. This is used mostly to control the bindings necessary for Trigger.
Public Functions
-
inline explicit EventLoop(std::vector<std::function<void()>> bindings)
Initialize the EventLoop with a vector of bindings.
- Parameters:
bindings – Vector storing the bindings to initialize the EventLoop
-
inline EventLoop(const std::initializer_list<std::function<void()>> bindings)
Initialize the EventLoop with a initializer list of bindings.
- Parameters:
bindings – Initializer list for new bindings
-
inline void poll()
Poll is run every frame and runs each of the bindings. This is generally run by the CommandScheduler.
-
inline void bind(const std::function<void()> &binding)
Bind a new command to the EventLoop.
- Parameters:
binding – The void function binding to run every frame
-
inline void clear()
Clear all bindings on this event loop.
-
inline explicit EventLoop(std::vector<std::function<void()>> bindings)