/** * returns the six adjacent coordinates on a standard keyboard, where each row is slanted to the * right from the last. adjacencies are clockwise, starting with key to the left, then two keys * above, then right key, then two keys below. (that is, only near-diagonal keys are adjacent, * so g's coordinate is adjacent to those of t,y,b,v, but not those of r,u,n,c.) */ @Override protected List<Position> getAdjacentCoords(final Position position) { return Arrays.asList( Position.of(position.getX() - 1, position.getY()), Position.of(position.getX(), position.getY() - 1), Position.of(position.getX() + 1, position.getY() - 1), Position.of(position.getX() + 1, position.getY()), Position.of(position.getX(), position.getY() + 1), Position.of(position.getX() - 1, position.getY() + 1)); }
/** * returns the six adjacent coordinates on a standard keyboard, where each row is slanted to the * right from the last. adjacencies are clockwise, starting with key to the left, then two keys * above, then right key, then two keys below. (that is, only near-diagonal keys are adjacent, * so g's coordinate is adjacent to those of t,y,b,v, but not those of r,u,n,c.) */ @Override protected List<Position> getAdjacentCoords(final Position position) { return Arrays.asList( Position.of(position.getX() - 1, position.getY()), Position.of(position.getX(), position.getY() - 1), Position.of(position.getX() + 1, position.getY() - 1), Position.of(position.getX() + 1, position.getY()), Position.of(position.getX(), position.getY() + 1), Position.of(position.getX() - 1, position.getY() + 1)); }
/** * returns the nine clockwise adjacent coordinates on a keypad, where each row is vert aligned. */ @Override protected List<Position> getAdjacentCoords(final Position position) { return Arrays.asList( Position.of(position.getX() - 1, position.getY()), Position.of(position.getX() - 1, position.getY() - 1), Position.of(position.getX(), position.getY() - 1), Position.of(position.getX() + 1, position.getY() - 1), Position.of(position.getX() + 1, position.getY()), Position.of(position.getX() + 1, position.getY() + 1), Position.of(position.getX(), position.getY() + 1), Position.of(position.getX() - 1, position.getY() + 1)); } }
/** * returns the nine clockwise adjacent coordinates on a keypad, where each row is vert aligned. */ @Override protected List<Position> getAdjacentCoords(final Position position) { return Arrays.asList( Position.of(position.getX() - 1, position.getY()), Position.of(position.getX() - 1, position.getY() - 1), Position.of(position.getX(), position.getY() - 1), Position.of(position.getX() + 1, position.getY() - 1), Position.of(position.getX() + 1, position.getY()), Position.of(position.getX() + 1, position.getY() + 1), Position.of(position.getX(), position.getY() + 1), Position.of(position.getX() - 1, position.getY() + 1)); } }