Beginnetje gemaakt met loop om events van devices te ontvangen en hun action door te sturen naar de huidige applicatie. Onderscheid gemaakt tussen events voor applicaties (start, pauze, enz) en events voor de main (exit, volgend device, enz). Misschien van event een betere uitgebreidere nuttigere wrapper maken voor een action.
This commit is contained in:
9
java/src/pm/event/ApplicationEvent.java
Normal file
9
java/src/pm/event/ApplicationEvent.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package pm.event;
|
||||
|
||||
import pm.action.Action;
|
||||
|
||||
public class ApplicationEvent extends Event {
|
||||
public ApplicationEvent(Action action) {
|
||||
super(action);
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,14 @@ package pm.event;
|
||||
|
||||
import pm.action.Action;
|
||||
|
||||
public class Event {
|
||||
public abstract class Event {
|
||||
protected Action action;
|
||||
|
||||
|
||||
public Event(Action action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public Action getAction() {
|
||||
return action;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user