add isValid overload that uses local state

This commit is contained in:
observer 2025-01-30 22:11:16 +00:00
parent ef8050a5f9
commit ea70aa5181
Signed by: observer
GPG Key ID: 2DE1FE56348E60D0

View File

@ -159,4 +159,13 @@ public class GridWrapper {
private boolean isValid(int column, int row) {
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;
}
}