implementing train actions

This commit is contained in:
Stephan Richter
2020-09-18 23:50:19 +02:00
parent 2f3251660d
commit cf4df1882e
6 changed files with 75 additions and 44 deletions

View File

@@ -2,6 +2,11 @@ package de.srsoftware.web4rail.moving;
import java.util.Vector;
import de.keawe.tools.translations.Translation;
import de.srsoftware.tools.Tag;
import de.srsoftware.web4rail.Application;
import de.srsoftware.web4rail.Window;
public class Train {
private Vector<Locomotive> locos = new Vector<Locomotive>();
private Vector<Car> cars = new Vector<Car>();
@@ -28,4 +33,14 @@ public class Train {
public String name() {
return name != null ? name : locos.firstElement().name();
}
public Tag props() {
Window window = new Window("train-properties",t("Properties of {}",getClass().getSimpleName()));
return window;
}
private String t(String message, Object...fills) {
return Translation.get(Application.class, message, fills);
}
}