Begin gemaakt met Events. Ik neem aan dat elk Event een Feature gaat bevatten. In de main houden we een Queue met Events vast, en we kunnen voor elk Event de feature opvragen en daarna gelijk uitvoeren!
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Testen...!");
|
||||
System.out.println("Nog meer testen....");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package pm.device.feature;
|
||||
|
||||
public interface Feature {
|
||||
|
||||
public void apply();
|
||||
}
|
||||
|
||||
16
java/src/pm/event/Event.java
Normal file
16
java/src/pm/event/Event.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package pm.event;
|
||||
|
||||
import pm.device.feature.Feature;
|
||||
|
||||
public class Event {
|
||||
public Feature feature;
|
||||
|
||||
public Event(Feature feature) {
|
||||
this.feature = feature;
|
||||
}
|
||||
|
||||
public void Apply() {
|
||||
feature.apply();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user