From 2eb488f14a0df930641a150b02e3c18c75cb84a3 Mon Sep 17 00:00:00 2001 From: Arthur <78031901+Arthur7770@users.noreply.github.com> Date: Tue, 23 Mar 2021 10:27:30 +0100 Subject: [PATCH] Adding player --- src/battleship/Battleship.java | 1 - src/battleship/model/player/Player.java | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/battleship/model/player/Player.java diff --git a/src/battleship/Battleship.java b/src/battleship/Battleship.java index 6df572f..daa2d2d 100644 --- a/src/battleship/Battleship.java +++ b/src/battleship/Battleship.java @@ -3,7 +3,6 @@ package battleship; public class Battleship { public static void main(String[] args) { - } } diff --git a/src/battleship/model/player/Player.java b/src/battleship/model/player/Player.java new file mode 100644 index 0000000..900a03d --- /dev/null +++ b/src/battleship/model/player/Player.java @@ -0,0 +1,22 @@ +package battleship.model.player; + +import battleship.utils.Triplet; + +import java.util.ArrayList; + +public abstract class Player { + + protected ArrayList ships = new ArrayList<>(); + protected ArrayList moves = new ArrayList<>(); + + public Player(){ + setShips(); + } + public void setShips(){ + + } + public void addMove(Triplet move){ + moves.add(move); + } + public abstract Triplet chooseMove(); +}