From e82471caa586e0c4d3fdabb9b2d5f577b78f12d7 Mon Sep 17 00:00:00 2001 From: Julius Dewender Date: Fri, 15 Jan 2021 17:48:02 +0100 Subject: [PATCH] renamed nums --- fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java | 2 +- fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java b/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java index 8d39fdd..6f0f751 100644 --- a/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java +++ b/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java @@ -26,7 +26,7 @@ public class Figure return false; } - if (src / 8 - dst / 8 < 0 && src % 8 - dst % 8 > 0) // diagonal nach rechts oben + if (src / fieldLength - dst / fieldLength < 0 && src % fieldLength - dst % fieldLength > 0) // diagonal nach rechts oben { return false; } diff --git a/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java b/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java index e451411..2406f7e 100644 --- a/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java +++ b/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java @@ -67,6 +67,6 @@ class FigureTest void whiteRookInvalidMoveLeftDown() // diagonal nach links unten { Figure f = new Figure(); - assertFalse(f.moveAllowed(36, 43, new int[8 * 8])); + assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 5 + 3, new int[Figure.fieldLength * Figure.fieldLength])); } } \ No newline at end of file