Endret metodenavn for mer lesbarhet

This commit is contained in:
GabrielMagnus 2020-03-16 16:46:22 +01:00
parent f01576d34e
commit 14dfbea630

View File

@ -345,7 +345,7 @@ public class Board {
* @param walls The walls you want all positions for * @param walls The walls you want all positions for
* @return A list of BoardElementContainers * @return A list of BoardElementContainers
*/ */
public List<BoardElementContainer<Wall>> getPositionsOfTileOnBoard(WallType ... walls) { public List<BoardElementContainer<Wall>> getPositionsOfWallOnBoard(WallType ... walls) {
List<BoardElementContainer<Wall>> combinedList = new ArrayList<>(); List<BoardElementContainer<Wall>> combinedList = new ArrayList<>();
for (WallType wall : walls) { for (WallType wall : walls) {
combinedList.addAll(makeTileList(wall, this.walls)); combinedList.addAll(makeTileList(wall, this.walls));
@ -367,6 +367,7 @@ public class Board {
for (int y = grid.getHeight() - 1; y >= 0; y--) { for (int y = grid.getHeight() - 1; y >= 0; y--) {
for (int x = 0; x < grid.getWidth(); x++) { for (int x = 0; x < grid.getWidth(); x++) {
T gridElement = grid.getElement(x, y); T gridElement = grid.getElement(x, y);
if (gridElement != null) {
if (gridElement.getClass().isAssignableFrom(Tile.class)) { if (gridElement.getClass().isAssignableFrom(Tile.class)) {
Tile tile = (Tile) gridElement; Tile tile = (Tile) gridElement;
if (tile.getTileType() == type) { if (tile.getTileType() == type) {
@ -382,6 +383,7 @@ public class Board {
} }
} }
} }
}
return objList; return objList;
} }
} }