diff --git a/src/main/java/de/tims/fleetstorm/ai/Logic.java b/src/main/java/de/tims/fleetstorm/ai/Logic.java index 6a93698..2c198d4 100644 --- a/src/main/java/de/tims/fleetstorm/ai/Logic.java +++ b/src/main/java/de/tims/fleetstorm/ai/Logic.java @@ -12,10 +12,10 @@ public class Logic { private Coordinate lastShot; public Coordinate target; private boolean foundShip = false; - public boolean clearedAbove = false; - public boolean clearedBelow = false; - public boolean clearedRight = false; - public boolean clearedLeft = false; + private boolean clearedAbove = false; + private boolean clearedBelow = false; + private boolean clearedRight = false; + private boolean clearedLeft = false; public Coordinate chooseField() { ArrayList possibleFields = new ArrayList(); @@ -124,4 +124,20 @@ public class Logic { } } + + public boolean getClearedAbove() { + return this.clearedAbove; + } + + public boolean getClearedBelow() { + return this.clearedBelow; + } + + public boolean getClearedRight() { + return this.clearedRight; + } + + public boolean getClearedLeft() { + return this.clearedLeft; + } } diff --git a/src/test/java/de/tims/fleetstorm/ai/LogicTest.java b/src/test/java/de/tims/fleetstorm/ai/LogicTest.java index 622eebb..dbce6ea 100644 --- a/src/test/java/de/tims/fleetstorm/ai/LogicTest.java +++ b/src/test/java/de/tims/fleetstorm/ai/LogicTest.java @@ -138,7 +138,7 @@ class LogicTest { logic.clearAbove(shot); - assertEquals(logic.clearedAbove, true); + assertEquals(logic.getClearedAbove(), true); } @Test @@ -155,7 +155,7 @@ class LogicTest { logic.clearBelow(shot); - assertEquals(logic.clearedBelow, true); + assertEquals(logic.getClearedBelow(), true); } @Test @@ -172,7 +172,7 @@ class LogicTest { logic.clearRight(shot); - assertEquals(logic.clearedRight, true); + assertEquals(logic.getClearedRight(), true); } @Test @@ -189,6 +189,6 @@ class LogicTest { logic.clearLeft(shot); - assertEquals(logic.clearedLeft, true); + assertEquals(logic.getClearedLeft(), true); } }