From e983c5aa13da3d1f20f27ab84bcb32d208aa797c Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Mon, 27 Feb 2023 11:22:07 +0100 Subject: [PATCH] Adding Map class Signed-off-by: Anthony Debucquoy --- app/src/main/java/school_project/Map.java | 20 +++++++++++++++++++ app/src/main/java/school_project/Piece.java | 1 + .../main/java/school_project/Position.java | 2 ++ 3 files changed, 23 insertions(+) create mode 100644 app/src/main/java/school_project/Map.java create mode 100644 app/src/main/java/school_project/Position.java diff --git a/app/src/main/java/school_project/Map.java b/app/src/main/java/school_project/Map.java new file mode 100644 index 0000000..e9834c0 --- /dev/null +++ b/app/src/main/java/school_project/Map.java @@ -0,0 +1,20 @@ +package school_project; + +import java.util.ArrayList; + +public class Map extends Shape{ + private ArrayList pieces; + + public Map(boolean[][] matrix) { + super(matrix); + } + + public Map() { + super(); + } + + // TODO: 2/27/23 Tests for Map + public void AddShape(Piece piece){ + pieces.add(piece); + } +} diff --git a/app/src/main/java/school_project/Piece.java b/app/src/main/java/school_project/Piece.java index 3a92feb..50d7c4e 100644 --- a/app/src/main/java/school_project/Piece.java +++ b/app/src/main/java/school_project/Piece.java @@ -2,6 +2,7 @@ package school_project; public class Piece extends Shape{ + private int x,y; // Position in the Map Object public Piece() { super(); } diff --git a/app/src/main/java/school_project/Position.java b/app/src/main/java/school_project/Position.java new file mode 100644 index 0000000..a981709 --- /dev/null +++ b/app/src/main/java/school_project/Position.java @@ -0,0 +1,2 @@ +package school_project; +