|
@ -14,6 +14,7 @@ public class Logic { |
|
|
private boolean foundShip = false; |
|
|
private boolean foundShip = false; |
|
|
public boolean clearedAbove = false; |
|
|
public boolean clearedAbove = false; |
|
|
public boolean clearedBelow = false; |
|
|
public boolean clearedBelow = false; |
|
|
|
|
|
public boolean clearedRight = false; |
|
|
|
|
|
|
|
|
public Coordinate chooseField() { |
|
|
public Coordinate chooseField() { |
|
|
ArrayList<Coordinate> possibleFields = new ArrayList<Coordinate>(); |
|
|
ArrayList<Coordinate> possibleFields = new ArrayList<Coordinate>(); |
|
@ -104,4 +105,13 @@ public class Logic { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void clearRight(Coordinate shot) { |
|
|
|
|
|
target = matchfield.getRight(shot); |
|
|
|
|
|
|
|
|
|
|
|
if (target.getState() == Coordinate.EMPTY) { |
|
|
|
|
|
clearedRight = true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |