ComponentDropLocation (Direction direction) { if (direction == Direction.DOWN && myYPart < 2) { return createAdjacentLocation(myXPart, myYPart+1); } if (direction == Direction.UP && myYPart > 0) { return createAdjacentLocation(myXPart, myYPart-1); } if (direction == Direction.RIGHT && myXPart < 2) { return createAdjacentLocation(myXPart+1, myYPart); } if (direction == Direction.LEFT && myXPart > 0) { return createAdjacentLocation(myXPart-1, myYPart); } return null; }