Legger til en funksjon for å få alle levende roboter fra Board

This commit is contained in:
Kristian Knarvik 2020-02-23 20:26:11 +01:00
parent 232e28aed0
commit fbbfed1932

View File

@ -73,6 +73,14 @@ public class Board {
deadRobots = new ArrayList<>();
}
/**
* Gets all alive robots from the board
* @return A list of alive robots
*/
public List<Robot> getAliveRobots() {
return new ArrayList<>(robots.values());
}
/**
* Removes a dead robot from the board over to the dead robot list
* @param robot the dead robot