Begin gemaakt met devices die events kunnen sturen naar applications via main opdat actions worden uitgevoerd.
This commit is contained in:
@@ -1,31 +1,18 @@
|
||||
package pm.device;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Queue;
|
||||
|
||||
import pm.device.feature.Feature;
|
||||
import pm.event.Event;
|
||||
|
||||
|
||||
public abstract class Device {
|
||||
protected ArrayList<Feature> featureList;
|
||||
protected Queue<Event> eventQueue;
|
||||
|
||||
protected Device() {
|
||||
featureList = new ArrayList<Feature>();
|
||||
protected Device(Queue<Event> eventQueue) {
|
||||
this.eventQueue = eventQueue;
|
||||
initialise();
|
||||
}
|
||||
|
||||
public void addFeature(Feature feature) {
|
||||
if (!hasFeature(feature)) {
|
||||
if (this instanceof feature.getClass()) {
|
||||
|
||||
}
|
||||
featureList.add(feature);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeFeature(Feature feature) {
|
||||
featureList.remove(feature);
|
||||
}
|
||||
|
||||
public boolean hasFeature(Feature feature) {
|
||||
return featureList.contains(feature);
|
||||
}
|
||||
public void initialise() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user