Attempt to separate framework from game impl.

This commit is contained in:
Ondřej Hruška
2014-04-08 14:48:24 +02:00
parent 8e8e15355e
commit 251475557f
101 changed files with 698 additions and 523 deletions
@@ -0,0 +1,51 @@
package mightypork.rogue.events;
import mightypork.gamecore.control.bus.events.Event;
import mightypork.gamecore.control.bus.events.types.SingleReceiverEvent;
/**
* Request for a global sction to be done in the main loop.
*
* @author MightyPork
*/
@SingleReceiverEvent
public class ActionRequest implements Event<ActionRequest.Listener> {
private final RequestType type;
public ActionRequest(RequestType request) {
type = request;
}
@Override
public void handleBy(Listener handler)
{
handler.requestAction(type);
}
public interface Listener {
/**
* Perform the requested action
*
* @param request
*/
void requestAction(RequestType request);
}
@Override
public String toString()
{
return "ActionRequest(" + type + ")";
}
public static enum RequestType
{
FULLSCREEN, SCREENSHOT, SHUTDOWN;
}
}