This commit is contained in:
djmil 2023-09-27 17:28:54 +02:00
parent 162e5c97dc
commit 58da85a5fd

View File

@ -128,7 +128,7 @@ public class CheckersMoveTest {
return Jump.intersect(allJumps, allSteps); return Jump.intersect(allJumps, allSteps);
} }
public Set<Jump> getWhiteJumps(Integer idx) { public static Set<Jump> getWhiteJumps(Integer idx) {
final var allSteps = getWhiteSteps(idx); final var allSteps = getWhiteSteps(idx);
final var allJumps = adjacentCell.get(idx).stream() final var allJumps = adjacentCell.get(idx).stream()
.filter(cur -> idx > cur && idx - cur > 5) .filter(cur -> idx > cur && idx - cur > 5)
@ -137,7 +137,7 @@ public class CheckersMoveTest {
return Jump.intersect(allJumps, allSteps); return Jump.intersect(allJumps, allSteps);
} }
public Set<Jump> getKingJumps(Integer idx) { public static Set<Jump> getKingJumps(Integer idx) {
final var allSteps = getKingSteps(idx); final var allSteps = getKingSteps(idx);
final var allJumps = adjacentCell.get(idx).stream() final var allJumps = adjacentCell.get(idx).stream()
.filter(cur -> abs(idx - cur) > 5) .filter(cur -> abs(idx - cur) > 5)