Browse Source

figure movement: white farmer invalid step direction "bottom"

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

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

@ -11,11 +11,16 @@ public class Figure
return false;
}
if (field.length == fieldSize)
if (field.length != fieldSize)
{
return true;
return false;
}
if (dst >= 56)
{
return false;
}
return false;
return true;
}
}

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

@ -40,4 +40,11 @@ class FigureTest
Figure f = new Figure();
assertTrue(f.moveAllowed(48,40, new int[Figure.fieldSize]));
}
@Test
void whiteFarmerInvalidDestinationDown() // statt nach "oben" wird nach "unten" gegangen
{
Figure f = new Figure();
assertFalse(f.moveAllowed(48,56, new int[Figure.fieldSize]));
}
}
Loading…
Cancel
Save