add isValid overload that uses local state
This commit is contained in:
parent
ef8050a5f9
commit
79ab2eeeca
@ -159,4 +159,13 @@ public class GridWrapper {
|
|||||||
private boolean isValid(int column, int row) {
|
private boolean isValid(int column, int row) {
|
||||||
return column >= 0 && column < COLUMNS && row >= 0 && row < ROWS;
|
return column >= 0 && column < COLUMNS && row >= 0 && row < ROWS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a given column and row is in bounds using local state
|
||||||
|
*
|
||||||
|
* @return A boolean representing the tile being in bounds.
|
||||||
|
*/
|
||||||
|
public boolean isValid() {
|
||||||
|
return this.currentColumn >= 0 && this.currentColumn < COLUMNS && this.currentRow >= 0 && this.currentRow < ROWS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user