Ship findShip(int[] coordinates){
for (int i = 0; i < ships.size();i++){
Ship ship = ships.get(i);
int shipX = ship.x;
int shipY = ship.y;
for (int tile = 0; tile < ship.size; tile++){
if (ship.rotated){
if (shipY == coordinates[1] && shipX + tile == coordinates[0]){
return ship;
}
}
else{
if(shipY + tile == coordinates[1] && shipX == coordinates[0]){
return ship;
}
}
}
}
}
The console returns that the return type must be a Ship, I have been playing with the scope for days and it is killing me
This method must return a result of type UltimateBattleshipV2.Ship.