private boolean allPositionsFlattened() { for (RelativePoint relativePosition : requester.getBuildingType().getProtectedTiles()) { if (needsToBeWorkedOn(relativePosition.calculatePoint(requester.getPos()))) { return false; } } return true; }
private ShortPoint2D getDiggablePosition() { RelativePoint[] blockedTiles = requester.getBuildingType().getProtectedTiles(); ShortPoint2D buildingPos = requester.getPos(); int offset = MatchConstants.random().nextInt(blockedTiles.length); for (int i = 0; i < blockedTiles.length; i++) { ShortPoint2D pos = blockedTiles[(i + offset) % blockedTiles.length].calculatePoint(buildingPos); if (!super.getGrid().isMarked(pos) && needsToBeWorkedOn(pos)) { return pos; } } return null; }