re-implented trailing calculations of train

This commit is contained in:
Stephan Richter
2020-11-05 18:27:12 +01:00
parent f9a3466f33
commit 0ef617aa34
16 changed files with 294 additions and 263 deletions

View File

@@ -15,7 +15,7 @@ public class StraightH extends StretchableTile{
if (oneWay == from) return new HashMap<>();
switch (from) {
case WEST:
return Map.of(new Connector(x+len(),y,Direction.WEST),State.UNDEF);
return Map.of(new Connector(x+width(),y,Direction.WEST),State.UNDEF);
case EAST:
return Map.of(new Connector(x-1,y,Direction.EAST),State.UNDEF);
default:
@@ -24,12 +24,17 @@ public class StraightH extends StretchableTile{
}
@Override
public int len() {
return length;
public int width() {
return stretch;
}
@Override
public List<Direction> possibleDirections() {
return List.of(Direction.EAST,Direction.WEST);
}
@Override
protected String stretchType() {
return t("Width");
}
}