re-connected loco actions
This commit is contained in:
@@ -58,13 +58,14 @@ public class Car implements Constants {
|
||||
|
||||
public static Object action(HashMap<String, String> params) throws IOException {
|
||||
Car car = Car.get(params.get(Car.ID));
|
||||
if (car == null) return t("No car with id {} found!",params.get(Car.ID));
|
||||
if (car == null) return t("No car with id {} found!",params.get(Car.ID));
|
||||
switch (params.get(ACTION)) {
|
||||
case ACTION_UPDATE:
|
||||
return car.update(params);
|
||||
case ACTION_PROPS:
|
||||
return car.properties();
|
||||
}
|
||||
case ACTION_UPDATE:
|
||||
return car.update(params);
|
||||
}
|
||||
if (car instanceof Locomotive) return Locomotive.action(params);
|
||||
return t("Unknown action: {}",params.get(ACTION));
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Locomotive extends Car implements Constants,Device{
|
||||
return loco.turn();
|
||||
}
|
||||
|
||||
return Car.action(params);
|
||||
return t("Unknown action: {}",params.get(ACTION));
|
||||
}
|
||||
|
||||
protected Tag cockpit(String realm) {
|
||||
|
||||
Reference in New Issue
Block a user