diff --git a/src/main/java/inf112/fiasko/roborally/objects/Board.java b/src/main/java/inf112/fiasko/roborally/objects/Board.java index ef6202b..9aeb897 100644 --- a/src/main/java/inf112/fiasko/roborally/objects/Board.java +++ b/src/main/java/inf112/fiasko/roborally/objects/Board.java @@ -310,14 +310,40 @@ public class Board { return elements; } - public List> getPositionsOfTileOnBoard(TileType tile) { - return makeTileList(tile, tiles); + /** + * Gets a list of BoardElementContainers, containing all tiles and positions of given tile types + * @param tiles The tiles you want all positions for + * @return A list of BoardElementContainers + */ + public List> getPositionsOfTileOnBoard(TileType ... tiles) { + List> combinedList = new ArrayList<>(); + for (TileType tile : tiles) { + combinedList.addAll(makeTileList(tile, this.tiles)); + } + return combinedList; } - public List> getPositionsOfTileOnBoard(WallType tile) { - return makeTileList(tile, walls); + /** + * Gets a list of BoardElementContainers, containing all tiles and positions of given wall types + * @param walls The walls you want all positions for + * @return A list of BoardElementContainers + */ + public List> getPositionsOfTileOnBoard(WallType ... walls) { + List> combinedList = new ArrayList<>(); + for (WallType wall : walls) { + combinedList.addAll(makeTileList(wall, this.walls)); + } + return combinedList; } + /** + * Finds all position of an obj and makes a list of BoardElementContainers + * @param type Type of obj + * @param grid Grid to search + * @param Type of type + * @param Type of grid + * @return List of BoardElementContainers + */ private List> makeTileList(K type, IGrid grid) { List> objList = new ArrayList<>();