code cleanup
This commit is contained in:
parent
ee6b348611
commit
52d0ace051
|
@ -160,7 +160,7 @@ class GameTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
void winner() {
|
void winner() {
|
||||||
game = new Game(new interFace("Test",new Integer[]{0,2,0},new PositionVector.Direction[]{RIGHT,
|
game = new Game(new Interface("Test",new Integer[]{0,2,0},new PositionVector.Direction[]{RIGHT,
|
||||||
RIGHT,
|
RIGHT,
|
||||||
RIGHT,
|
RIGHT,
|
||||||
NONE,
|
NONE,
|
||||||
|
@ -208,7 +208,7 @@ class GameTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
void crashA() {
|
void crashA() {
|
||||||
game = new Game(new interFace("Test",new Integer[]{0,1,0},new PositionVector.Direction[]{UP}), new Config());
|
game = new Game(new Interface("Test",new Integer[]{0,1,0},new PositionVector.Direction[]{UP}), new Config());
|
||||||
game.initPhase();
|
game.initPhase();
|
||||||
Assertions.assertEquals("b",game.gamePhase());
|
Assertions.assertEquals("b",game.gamePhase());
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ class GameTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
void passFinishLineInWrongDirection() {
|
void passFinishLineInWrongDirection() {
|
||||||
game = new Game(new interFace("Test",new Integer[]{1,0,1},new PositionVector.Direction[]{LEFT,NONE,NONE,RIGHT,RIGHT}), new Config());
|
game = new Game(new Interface("Test",new Integer[]{1,0,1},new PositionVector.Direction[]{LEFT,NONE,NONE,RIGHT,RIGHT}), new Config());
|
||||||
game.initPhase();
|
game.initPhase();
|
||||||
Assertions.assertEquals("a",game.gamePhase());
|
Assertions.assertEquals("a",game.gamePhase());
|
||||||
}
|
}
|
||||||
|
@ -241,15 +241,15 @@ class GameTest {
|
||||||
* This Class is used to communicate with the UserInterface. It overrides crucial methods and returns an instruction based on the instructions' data field.
|
* This Class is used to communicate with the UserInterface. It overrides crucial methods and returns an instruction based on the instructions' data field.
|
||||||
* To implement the right instructions the user has to be aware of the game sequence.
|
* To implement the right instructions the user has to be aware of the game sequence.
|
||||||
*/
|
*/
|
||||||
private class interFace extends UserInterface {
|
private class Interface extends UserInterface {
|
||||||
|
|
||||||
private final PositionVector.Direction[] directions;
|
private final PositionVector.Direction[] directions;
|
||||||
private final Integer[] instructions;
|
private final Integer[] instructions;
|
||||||
private int pointerDir,pointerInstruction;
|
private int pointerDir,pointerInstruction;
|
||||||
|
|
||||||
|
|
||||||
public interFace(String welcometxt, Integer[] instructions, PositionVector.Direction[] directions) {
|
public Interface(String welcometext, Integer[] instructions, PositionVector.Direction[] directions) {
|
||||||
super(welcometxt);
|
super(welcometext);
|
||||||
pointerDir = -1;
|
pointerDir = -1;
|
||||||
pointerInstruction = -1;
|
pointerInstruction = -1;
|
||||||
this.instructions = instructions;
|
this.instructions = instructions;
|
||||||
|
|
Loading…
Reference in New Issue