renamed turnouts, worked on route discovery
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
package de.srsoftware.web4rail.tiles;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import de.srsoftware.web4rail.Connector;
|
||||
import de.srsoftware.web4rail.Plan.Direction;
|
||||
import de.srsoftware.web4rail.tiles.Turnout.State;
|
||||
|
||||
public class StraightH extends StretchableTile{
|
||||
|
||||
@Override
|
||||
public List<Connector> connections(Direction from) {
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
switch (from) {
|
||||
case WEST:
|
||||
return List.of(new Connector(x+len(),y,Direction.WEST));
|
||||
return Map.of(new Connector(x+len(),y,Direction.WEST),State.UNDEF);
|
||||
case EAST:
|
||||
return List.of(new Connector(x-1,y,Direction.EAST));
|
||||
return Map.of(new Connector(x-1,y,Direction.EAST),State.UNDEF);
|
||||
default:
|
||||
return new Vector<>();
|
||||
return new HashMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user