@ -36,7 +36,7 @@ public class Locomotive extends Car implements Constants,Device{
@@ -36,7 +36,7 @@ public class Locomotive extends Car implements Constants,Device{
super(name);
}
publicLocomotive(Stringname,Stringid){
publicLocomotive(Stringname,Integerid){
super(name,id);
}
@ -120,8 +120,8 @@ public class Locomotive extends Car implements Constants,Device{
@@ -120,8 +120,8 @@ public class Locomotive extends Car implements Constants,Device{
@ -131,6 +131,8 @@ public class Train implements Comparable<Train>,Constants {
@@ -131,6 +131,8 @@ public class Train implements Comparable<Train>,Constants {
returntrain.addCar(params);
caseACTION_AUTO:
returntrain.automatic();
caseACTION_DROP:
returntrain.dropCar(params);
caseACTION_PROPS:
returntrain.props();
caseACTION_QUIT:
@ -147,6 +149,14 @@ public class Train implements Comparable<Train>,Constants {
@@ -147,6 +149,14 @@ public class Train implements Comparable<Train>,Constants {
if(!params.containsKey(CAR_ID))returnt("No car id passed to Train.addCar!");
@ -186,7 +196,13 @@ public class Train implements Comparable<Train>,Constants {
@@ -186,7 +196,13 @@ public class Train implements Comparable<Train>,Constants {
@ -230,10 +246,10 @@ public class Train implements Comparable<Train>,Constants {
@@ -230,10 +246,10 @@ public class Train implements Comparable<Train>,Constants {
if(direction!=null)json.put(DIRECTION,direction);
json.put(PUSH_PULL,pushPull);
if(name!=null)json.put(NAME,name);
Vector<String>locoIds=newVector<String>();
Vector<Integer>locoIds=newVector<Integer>();
for(Locomotiveloco:locos)locoIds.add(loco.id());
json.put(LOCOS,locoIds);
Vector<String>carIds=newVector<String>();
Vector<Integer>carIds=newVector<Integer>();
for(Carcar:cars)carIds.add(car.id());
json.put(CARS,carIds);
if(!tags.isEmpty())json.put(TAGS,tags);
@ -277,6 +293,7 @@ public class Train implements Comparable<Train>,Constants {
@@ -277,6 +293,7 @@ public class Train implements Comparable<Train>,Constants {
@ -285,9 +302,12 @@ public class Train implements Comparable<Train>,Constants {
@@ -285,9 +302,12 @@ public class Train implements Comparable<Train>,Constants {