/** Checks if the given point is in the array */ public static boolean inPointArray(Point[] haystack, Point needle) { for (Point option : haystack) { if (needle.getX() == option.getX() && needle.getY() == option.getY()) { return true; } } return false; }
public static byte[] getObjectPositionOffsets(Point p1, Point p2) { byte[] rv = new byte[2]; rv[0] = getObjectCoordOffset(p1.getX(), p2.getX()); rv[1] = getObjectCoordOffset(p1.getY(), p2.getY()); return rv; }