bugfixes
This commit is contained in:
@@ -240,7 +240,7 @@ public class Relay extends Tile implements Device{
|
||||
new Tag("option").attr("value","0").content(t("unset")).addTo(select);
|
||||
for (Relay relay : BaseClass.listElements(Relay.class)) {
|
||||
if (exclude.contains(relay)) continue;
|
||||
Tag opt = select.addOption(relay.id, relay);
|
||||
Tag opt = select.addOption(relay.id(), relay);
|
||||
if (relay == preselected) opt.attr("selected", "selected");
|
||||
}
|
||||
return select;
|
||||
|
||||
@@ -55,7 +55,7 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
|
||||
private int length = DEFAUT_LENGTH;
|
||||
protected Direction oneWay = null;
|
||||
protected Route route = null;
|
||||
private TreeSet<Route> routes = new TreeSet<>();
|
||||
private TreeSet<Route> routes = new TreeSet<>((r1,r2)->r1.toString().compareTo(r2.toString()));
|
||||
protected Train train = null;
|
||||
public Integer x = null;
|
||||
public Integer y = null;
|
||||
@@ -169,10 +169,11 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
|
||||
}
|
||||
|
||||
public Tile load(JSONObject json) {
|
||||
if (json.has(ID)) json.remove(ID); // id should be created from cordinates
|
||||
super.load(json);
|
||||
JSONObject pos = json.getJSONObject(POS);
|
||||
x = pos.getInt(X);
|
||||
y = pos.getInt(Y);
|
||||
y = pos.getInt(Y);
|
||||
if (json.has(DISABLED)) disabled = json.getBoolean(DISABLED);
|
||||
if (json.has(LENGTH)) length = json.getInt(LENGTH);
|
||||
if (json.has(ONEW_WAY)) oneWay = Direction.valueOf(json.getString(ONEW_WAY));
|
||||
|
||||
Reference in New Issue
Block a user