Remove USELESS class Battleship

This commit is contained in:
Arthur 2021-03-23 10:57:35 +01:00
parent 48ba657ef1
commit 609b2b821a
4 changed files with 24 additions and 12 deletions

View File

@ -1,9 +0,0 @@
package battleship.model;
import java.util.ArrayList;
public class Battleship {
public ArrayList<Ship> ships;
}

View File

@ -0,0 +1,11 @@
package battleship.model.player;
import battleship.utils.Triplet;
public class Human extends Player {
@Override
public Triplet chooseMove() {
return null;
}
}

View File

@ -8,7 +8,7 @@ import java.util.ArrayList;
public abstract class Player { public abstract class Player {
protected ArrayList<Ship> ships = new ArrayList<>(); protected ArrayList<Ship> ships = new ArrayList<>();
protected ArrayList<Triplet> moves = new ArrayList<>(); protected ArrayList<Triplet<Integer,Integer,Boolean>> moves = new ArrayList<>();
public Player(){ public Player(){
setShips(); setShips();
@ -18,8 +18,8 @@ public abstract class Player {
} }
public void addMove(Triplet move){ public void addMove(Triplet<Integer,Integer,Boolean> move){
moves.add(move); moves.add(move);
} }
public abstract Triplet chooseMove(); public abstract Triplet<Integer,Integer,Boolean> chooseMove();
} }

View File

@ -0,0 +1,10 @@
package battleship.model.player;
import battleship.utils.Triplet;
public class Random extends Player{
@Override
public Triplet chooseMove() {
return null;
}
}