Structuur consequenter gemaakt met initialise en exit methoden. De start methode wordt gereserveerd voor wanneer er een Thread moet worden gestart. Exceptions georganiseerd, hierbij opletten op het doorgeven van exceptions vanuit Threads! Poging tot het dynamisch toevoegen van devices is niet helemaal gelukt.
This commit is contained in:
@@ -24,8 +24,8 @@ public class WiimoteDevice extends Device {
|
||||
wiimote = wiimoteService.getDevice(this);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
super.start();
|
||||
public void initialise() {
|
||||
super.initialise();
|
||||
try {
|
||||
add(
|
||||
new Press(WiimoteButton.A),
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import pm.exception.DeviceException;
|
||||
import pm.exception.device.JavaInputDeviceNotFoundException;
|
||||
import pm.exception.device.javainput.JavaInputDeviceSpecificException;
|
||||
import wiiusej.WiiUseApiManager;
|
||||
import wiiusej.Wiimote;
|
||||
import wiiusej.wiiusejevents.GenericEvent;
|
||||
@@ -54,7 +54,7 @@ public class WiimoteService extends WiiUseApiManager implements WiimoteListener
|
||||
return wiimote;
|
||||
}
|
||||
}
|
||||
throw new JavaInputDeviceNotFoundException();
|
||||
throw new JavaInputDeviceSpecificException();
|
||||
}
|
||||
|
||||
public Wiimote getWiimote(GenericEvent event) {
|
||||
|
||||
Reference in New Issue
Block a user