Browse Source

refactored nums

feat-figureMovement
JD 4 years ago
parent
commit
354d2fc4d6
  1. 2
      fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java
  2. 2
      fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java

2
fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java

@ -31,7 +31,7 @@ public class Figure
return false; return false;
} }
if (src / 8 - dst / 8 < 0 && src % 8 - dst % 8 < 0) // diagonal nach rechts unten
if (src / fieldLength - dst / fieldLength < 0 && src % fieldLength - dst % fieldLength < 0) // diagonal nach rechts unten
{ {
return false; return false;
} }

2
fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java

@ -74,6 +74,6 @@ class FigureTest
void whiteRookInvalidMoveRightDown() // diagonal nach rechts unten void whiteRookInvalidMoveRightDown() // diagonal nach rechts unten
{ {
Figure f = new Figure(); Figure f = new Figure();
assertFalse(f.moveAllowed(36, 45, new int[8 * 8]));
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 5 + 5, new int[Figure.fieldLength * Figure.fieldLength]));
} }
} }
Loading…
Cancel
Save