boolean lineScanner(Direction direction) { String checkQuad = af.getQuadrant(this.x, this.y); int checkX = Integer.parseInt(checkQuad.substring(0, checkQuad.indexOf("_"))); int checkY = Integer.parseInt(checkQuad.substring(checkQuad.indexOf("_") + 1)); if (checkX >= 0 && checkX < 9 && checkY >= 0 && checkY < 9) { if (checkDirection(direction, checkX, checkY)) { return true; } } return false; }