From 2da7baeb77c7e42c8e5fb51c3271c6243b3a4f92 Mon Sep 17 00:00:00 2001 From: Tobydrama Date: Sat, 22 Feb 2020 14:40:00 +0100 Subject: [PATCH] Started on the board class --- .../roborally/element_properties/Board.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/java/inf112/fiasko/roborally/element_properties/Board.java diff --git a/src/main/java/inf112/fiasko/roborally/element_properties/Board.java b/src/main/java/inf112/fiasko/roborally/element_properties/Board.java new file mode 100644 index 0000000..712846a --- /dev/null +++ b/src/main/java/inf112/fiasko/roborally/element_properties/Board.java @@ -0,0 +1,34 @@ +package inf112.fiasko.roborally.element_properties; + +import inf112.fiasko.roborally.objects.Grid; +import inf112.fiasko.roborally.objects.Robot; + +import java.util.ArrayList; + +public class Board { + private Grid walls; + private Grid otherObjects; + private ArrayList deadRobots = new ArrayList<>(); + private ArrayList aliveRobots; + + /** + * Initializes the board + * @param walls a grid containing all the walls + * @param otherObjects a grid containing all the other Objects like flags and conveyor belts + * @param aliveRobots a list of all the robots that are currently alive + */ + public void Board(Grid walls, Grid otherObjects, ArrayList aliveRobots){ + this.walls=walls; + this.otherObjects=otherObjects; + this.aliveRobots=aliveRobots; + } + + /** + * removes a dead robot from the board over to the dead robot list. + * @param robot the dead robot + */ + public void removeDeadRobotFromBoard(Robot robot){ + aliveRobots.remove(robot); + deadRobots.add(robot); + } +}