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.
30 lines
701 B
30 lines
701 B
package de.srsoftware.web4rail.tiles; |
|
|
|
import java.util.List; |
|
import java.util.Map; |
|
|
|
import de.srsoftware.web4rail.Connector; |
|
import de.srsoftware.web4rail.Plan.Direction; |
|
import de.srsoftware.web4rail.tiles.Turnout.State; |
|
|
|
public class BridgeE extends Bridge { |
|
@Override |
|
public List<Direction> possibleDirections() { |
|
return List.of(Direction.EAST); |
|
} |
|
|
|
@Override |
|
public Map<Connector, State> connections(Direction from) { |
|
if (isSet(counterpart)) switch (from) { |
|
case EAST: |
|
return Map.of(counterpart.connector(),State.UNDEF); |
|
default: |
|
} |
|
return super.connections(from); |
|
} |
|
|
|
@Override |
|
protected Connector connector() { |
|
return new Connector(x+1, y, Direction.WEST); |
|
} |
|
}
|
|
|