Classes die op de verkeerde plek stonden verplaatst. Vergeten aanpassingen in WiimoteDevice doorgevoerd.
This commit is contained in:
@@ -3,8 +3,8 @@ package pm.device.wiimote;
|
||||
import pm.Action;
|
||||
import pm.Target;
|
||||
import pm.device.Device;
|
||||
import pm.exception.DeviceException;
|
||||
import pm.exception.MacroException;
|
||||
import pm.exception.device.DeviceInitialiseException;
|
||||
import pm.macro.event.Press;
|
||||
import wiiusej.Wiimote;
|
||||
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
|
||||
@@ -16,16 +16,12 @@ public class WiimoteDevice extends Device {
|
||||
|
||||
protected Wiimote wiimote;
|
||||
|
||||
{
|
||||
public WiimoteDevice() {
|
||||
WiimoteDevice.wiimoteService = new WiimoteService();
|
||||
}
|
||||
|
||||
public WiimoteDevice() throws DeviceException {
|
||||
public void initialise() throws DeviceInitialiseException {
|
||||
wiimote = wiimoteService.getDevice(this);
|
||||
}
|
||||
|
||||
public void initialise() {
|
||||
super.initialise();
|
||||
try {
|
||||
add(
|
||||
new Press(WiimoteButton.A),
|
||||
|
||||
@@ -3,8 +3,7 @@ package pm.device.wiimote;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import pm.exception.DeviceException;
|
||||
import pm.exception.device.javainput.JavaInputDeviceSpecificException;
|
||||
import pm.exception.device.DeviceNotFoundException;
|
||||
import wiiusej.WiiUseApiManager;
|
||||
import wiiusej.Wiimote;
|
||||
import wiiusej.wiiusejevents.GenericEvent;
|
||||
@@ -43,7 +42,7 @@ public class WiimoteService extends WiiUseApiManager implements WiimoteListener
|
||||
definitiveShutdown();
|
||||
}
|
||||
|
||||
public Wiimote getDevice(WiimoteDevice wiimoteDevice) throws DeviceException {
|
||||
public Wiimote getDevice(WiimoteDevice wiimoteDevice) throws DeviceNotFoundException {
|
||||
Wiimote[] wiimoteArray = getWiimotes(1, false);
|
||||
for (Wiimote wiimote : wiimoteArray) {
|
||||
int id = wiimote.getId();
|
||||
@@ -54,7 +53,7 @@ public class WiimoteService extends WiiUseApiManager implements WiimoteListener
|
||||
return wiimote;
|
||||
}
|
||||
}
|
||||
throw new JavaInputDeviceSpecificException();
|
||||
throw new DeviceNotFoundException();
|
||||
}
|
||||
|
||||
public Wiimote getWiimote(GenericEvent event) {
|
||||
|
||||
Reference in New Issue
Block a user