bugfix
This commit is contained in:
@@ -13,6 +13,7 @@ public class BlockH extends Block{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from)) return new HashMap<Connector, Turnout.State>();
|
||||
switch (from) {
|
||||
case WEST:
|
||||
return Map.of(new Connector(x+width(),y,Direction.WEST),State.UNDEF);
|
||||
|
||||
@@ -13,6 +13,7 @@ public class BlockV extends Block{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from)) return new HashMap<Connector, Turnout.State>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x,y+height(),Direction.NORTH),State.UNDEF);
|
||||
|
||||
@@ -11,7 +11,7 @@ import de.srsoftware.web4rail.tiles.Turnout.State;
|
||||
public class ContactH extends Contact {
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (oneWay == from) return new HashMap<>();
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case WEST:
|
||||
return Map.of(new Connector(x+1,y,from),State.UNDEF);
|
||||
|
||||
@@ -12,7 +12,7 @@ public class ContactV extends Contact {
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (oneWay == from) return new HashMap<>();
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x,y+1,from),State.UNDEF);
|
||||
|
||||
@@ -13,6 +13,7 @@ public class CrossH extends Cross{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from)) return new HashMap<>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x+1,y+1,Direction.NORTH),State.UNDEF);
|
||||
@@ -30,6 +31,7 @@ public class CrossH extends Cross{
|
||||
|
||||
@Override
|
||||
public Map<Connector,State> offsetConnections(Direction from) {
|
||||
if (isNull(from)) return new HashMap<>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x,y+1,Direction.NORTH),State.UNDEF);
|
||||
|
||||
@@ -11,6 +11,7 @@ public class DiagES extends Tile{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from)) return new HashMap<>();
|
||||
switch (from) {
|
||||
case SOUTH:
|
||||
return Map.of(new Connector(x+1,y,Direction.WEST),State.UNDEF);
|
||||
|
||||
@@ -11,6 +11,7 @@ public class DiagNE extends Tile{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from)) return new HashMap<>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x+1,y,Direction.WEST),State.UNDEF);
|
||||
|
||||
@@ -10,6 +10,7 @@ import de.srsoftware.web4rail.tiles.Turnout.State;
|
||||
public class DiagSW extends Tile{
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from)) return new HashMap<>();
|
||||
switch (from) {
|
||||
case SOUTH:
|
||||
return Map.of(new Connector(x-1,y,Direction.EAST),State.UNDEF);
|
||||
|
||||
@@ -11,6 +11,8 @@ public class DiagWN extends Tile{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from)) return new HashMap<>();
|
||||
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x-1,y,Direction.EAST),State.UNDEF);
|
||||
|
||||
@@ -11,7 +11,7 @@ import de.srsoftware.web4rail.tiles.Turnout.State;
|
||||
public class SignalE extends Signal{
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (oneWay == from) return new HashMap<>();
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case WEST:
|
||||
return Map.of(new Connector(x+1,y,Direction.WEST),State.UNDEF);
|
||||
|
||||
@@ -12,7 +12,7 @@ public class SignalN extends Signal {
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (oneWay == from) return new HashMap<>();
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x,y+1,Direction.NORTH),State.UNDEF);
|
||||
|
||||
@@ -12,7 +12,7 @@ public class SignalS extends Signal{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (oneWay == from) return new HashMap<>();
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x,y+1,Direction.NORTH),State.UNDEF);
|
||||
|
||||
@@ -11,7 +11,7 @@ import de.srsoftware.web4rail.tiles.Turnout.State;
|
||||
public class SignalW extends Signal{
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (oneWay == from) return new HashMap<>();
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case WEST:
|
||||
return Map.of(new Connector(x+1,y,Direction.WEST),State.UNDEF);
|
||||
|
||||
@@ -12,7 +12,7 @@ public class StraightH extends StretchableTile{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (oneWay == from) return new HashMap<>();
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case WEST:
|
||||
return Map.of(new Connector(x+width(),y,Direction.WEST),State.UNDEF);
|
||||
|
||||
@@ -12,7 +12,7 @@ public class StraightV extends StretchableTile{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (oneWay == from) return new HashMap<>();
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x,y+height(),Direction.NORTH),State.UNDEF);
|
||||
|
||||
@@ -16,6 +16,7 @@ public class Turnout3E extends Turnout{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case EAST:
|
||||
return Map.of(
|
||||
|
||||
@@ -10,6 +10,7 @@ public class TurnoutLE extends TurnoutL{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case EAST:
|
||||
return Map.of(new Connector(x,y+1,Direction.NORTH),State.LEFT,new Connector(x-1, y, Direction.EAST),State.STRAIGHT);
|
||||
|
||||
@@ -10,6 +10,7 @@ public class TurnoutLN extends TurnoutL{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x,y+1,Direction.NORTH),State.STRAIGHT,new Connector(x+1, y, Direction.WEST),State.LEFT);
|
||||
|
||||
@@ -10,6 +10,7 @@ public class TurnoutLS extends TurnoutL{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
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);
|
||||
|
||||
@@ -10,6 +10,7 @@ public class TurnoutLW extends TurnoutL{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case WEST:
|
||||
return Map.of(new Connector(x+1,y,Direction.WEST),State.STRAIGHT,new Connector(x, y-1, Direction.SOUTH),State.LEFT);
|
||||
|
||||
@@ -10,6 +10,7 @@ public class TurnoutRE extends TurnoutR{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case EAST:
|
||||
return Map.of(new Connector(x,y-1,Direction.SOUTH),State.RIGHT,new Connector(x-1, y, Direction.EAST),State.STRAIGHT);
|
||||
|
||||
@@ -10,6 +10,7 @@ public class TurnoutRN extends TurnoutR{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case NORTH:
|
||||
return Map.of(new Connector(x-1,y,Direction.EAST),State.RIGHT,new Connector(x, y+1, Direction.NORTH),State.STRAIGHT);
|
||||
|
||||
@@ -10,6 +10,7 @@ public class TurnoutRS extends TurnoutR{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case SOUTH:
|
||||
return Map.of(new Connector(x+1,y,Direction.WEST),State.RIGHT,new Connector(x, y-1, Direction.SOUTH),State.STRAIGHT);
|
||||
|
||||
@@ -10,6 +10,7 @@ public class TurnoutRW extends TurnoutR{
|
||||
|
||||
@Override
|
||||
public Map<Connector, State> connections(Direction from) {
|
||||
if (isNull(from) || oneWay == from) return new HashMap<>();
|
||||
switch (from) {
|
||||
case WEST:
|
||||
return Map.of(new Connector(x+1,y,Direction.WEST),State.STRAIGHT,new Connector(x, y+1, Direction.NORTH),State.RIGHT);
|
||||
|
||||
Reference in New Issue
Block a user