You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
661 B
24 lines
661 B
package de.srsoftware.web4rail.tiles; |
|
|
|
import java.util.HashMap; |
|
import java.util.Map; |
|
|
|
import de.srsoftware.web4rail.Connector; |
|
import de.srsoftware.web4rail.Plan.Direction; |
|
|
|
public class TurnoutLS extends Turnout{ |
|
|
|
@Override |
|
public Map<Connector, State> connections(Direction from) { |
|
switch (from) { |
|
case SOUTH: |
|
return Map.of(new Connector(x-1,y,Direction.EAST),State.LEFT,new Connector(x, y-1, Direction.SOUTH),State.STRAIGHT); |
|
case WEST: |
|
return Map.of(new Connector(x,y+1,Direction.NORTH),State.LEFT); |
|
case NORTH: |
|
return Map.of(new Connector(x,y+1,Direction.NORTH),State.STRAIGHT); |
|
default: |
|
return new HashMap<>(); |
|
} |
|
} |
|
}
|
|
|