mwhicks-dev / splat-alpha

2D platforming game engine based in C++ and built on top of the SFML multimedia suite.
0 stars 0 forks source link

Create and implement Controller and Listener interfaces #31

Closed mwhicks-dev closed 5 months ago

mwhicks-dev commented 5 months ago

Interfaces for ZMQ-based behaviors loosely described here.

Listener implementation should be finished first, as it is necessary for client-side behavior. Each Listener maintains a priority queue of Command objects which it processes in its own thread so long as the Entrypoint is still running. The interface itself will simply require a push_command(Command): void and run(void): void thread. (Internally, this should call a private non-static listener_thread(void): void thread in a loop on implementation, but this is not an interface requirement and is really user-defined.)

Controller implementations will provide standalone components used to send and receive ZMQ requests, though they are not really wrappers. Similar to Listeners, Controllers should have a push_outcoming_event(Event): void, but also need pop_incoming_event(void): Event and has_incoming(): bool functions for inbound events, whatever those may look like to the implementation. The Controller interface will also require a run(void): void function.