lucasjoshua #14
|
@ -51,7 +51,6 @@ public class Ship {
|
|||
private String name;
|
||||
private int hitsOnMe;
|
||||
private boolean sunk;
|
||||
private boolean isPlaced;
|
||||
|
||||
public Ship (int size, String name) {
|
||||
this.size = size;
|
||||
|
@ -63,6 +62,10 @@ public class Ship {
|
|||
this.isPlaced = false;
|
||||
}
|
||||
|
||||
public void resetPosition() {
|
||||
this.position = null;
|
||||
}
|
||||
|
||||
public boolean setPosition(Point pos, List<Ship> shipsList, int boardSize) {
|
||||
// ueberpruefe boundaries
|
||||
if (pos.getX() < 0 || pos.getY() < 0 || pos.getX() >= boardSize || pos.getY() >= boardSize) {
|
||||
|
|
Loading…
Reference in New Issue