|
@ -10,7 +10,9 @@ public class Logic { |
|
|
|
|
|
|
|
|
private Matchfield matchfield; |
|
|
private Matchfield matchfield; |
|
|
private Coordinate lastShot; |
|
|
private Coordinate lastShot; |
|
|
|
|
|
public Coordinate target; |
|
|
private boolean foundShip = false; |
|
|
private boolean foundShip = false; |
|
|
|
|
|
public boolean clearedAbove = false; |
|
|
|
|
|
|
|
|
public Coordinate chooseField() { |
|
|
public Coordinate chooseField() { |
|
|
ArrayList<Coordinate> possibleFields = new ArrayList<Coordinate>(); |
|
|
ArrayList<Coordinate> possibleFields = new ArrayList<Coordinate>(); |
|
@ -75,4 +77,22 @@ public class Logic { |
|
|
return this.foundShip; |
|
|
return this.foundShip; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void checkAround(Coordinate coordinate) { |
|
|
|
|
|
// TODO Auto-generated method stub |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void clearAbove(Coordinate shot) { |
|
|
|
|
|
target = matchfield.getAbove(shot); |
|
|
|
|
|
|
|
|
|
|
|
if (target.getState() == Coordinate.EMPTY) { |
|
|
|
|
|
clearedAbove = true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void shot() { |
|
|
|
|
|
// TODO Auto-generated method stub |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |