Stuff
public text v1 · immutable // isThisShip() - Decides if the coordinates passed are within the ship's present boundaries
public boolean isThisShip(int x, int y) {
if ((x > posX && x < posX + player.grid.squareWidth && y > posY && y < posY + player.grid.squareLength*length
&& orientation == VERTICAL) || (x > posX && x < posX + player.grid.squareWidth*length && y > posY
&& y < posY + player.grid.squareLength && orientation == HORIZONTAL))
return true;
else
return false;
}