Skip to content

Commit

Permalink
ref: removed system to search for PW only in signal direction
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Apr 26, 2024
1 parent fcd933b commit 2a2e034
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
22 changes: 0 additions & 22 deletions src/main/java/com/troblecodings/signals/signalbox/Point.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,6 @@ public void translate(final int x, final int y) {
this.y += y;
}

public Point translate(final Rotation rotation) {
final Point point = new Point(this);
switch (rotation) {
case NONE: {
point.x += 1;
break;
}
case CLOCKWISE_90: {
point.y -= 1;
break;
}
case CLOCKWISE_180: {
point.x -= 1;
break;
}
case COUNTERCLOCKWISE_90: {
point.y += 1;
}
}
return point;
}

public Point delta(final Point other) {
final Point point = new Point(this);
point.translate(-other.getX(), -other.getY());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,18 +289,6 @@ public PathwayRequestResult canMakePath(final Path path, final PathType type) {
return PathwayRequestResult.PASS;
}

public Point getStartPoint(final PathType type) {
for (final EnumGuiMode mode : type.getModes()) {
for (final Rotation rotation : Rotation.values()) {
final ModeSet modeSet = new ModeSet(mode, rotation);
if (!possibleModes.containsKey(modeSet))
continue;
return point.translate(rotation);
}
}
return null;
}

public boolean containsManuellOutput(final ModeSet mode) {
return manuellEnabledOutputs.contains(mode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ public static PathwayRequestResult requestPathway(final Map<Point, SignalBoxNode
checker.visited = visited;
PathwayRequestResult result = PathwayRequestResult.NO_PATH;

final Point startPoint = firstNode.getStartPoint(pathType);
for (final PathIdentifier pathIdent : firstNode.toPathIdentifier()) {
if (startPoint.equals(pathIdent.path.point2))
scores.put(pathIdent, getCosts(pathIdent.getMode(), firstNode, p1, p2));
scores.put(pathIdent, getCosts(pathIdent.getMode(), firstNode, p1, p2));
}

while (!scores.isEmpty()) {
Expand Down

0 comments on commit 2a2e034

Please sign in to comment.