Liste med døde spiller lagt til i Board

This commit is contained in:
Steinar Aalstad Lillesund 2020-04-14 14:54:15 +02:00
parent e8f1c16caa
commit c684630b04

View File

@ -23,6 +23,7 @@ public class Board {
private IGrid<Particle> particles;
private Map<RobotID, Robot> robots;
private List<Robot> deadRobots;
private List<Robot> realDeadRobots;
/**
* Initializes the board
@ -47,8 +48,15 @@ public class Board {
this.tiles = tiles;
this.particles = new Grid<>(tiles.getWidth(), tiles.getHeight());
this.deadRobots = new ArrayList<>();
this.realDeadRobots = new ArrayList<>();
}
/**
* All the Real dead player's robots.
* @return A list of Robots.
*/
public List<Robot> getRealDeadRobots() { return realDeadRobots; }
/**
* Gets the height of the board
* @return The height of the board
@ -349,6 +357,9 @@ public class Board {
robot.setDamageTaken(2);
robots.put(robot.getRobotId(), robot);
}
else {
realDeadRobots.add(robot);
}
}
deadRobots = new ArrayList<>();
}