From 87ba39bd34b32b77b00183746c8072f0a83d1c89 Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Date: Tue, 13 Aug 2024 13:41:27 +0200 Subject: [PATCH] [#817] Area contains Point function added. --- .../src/main/java/com/b3dgs/lionengine/geom/Area.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lionengine-core/src/main/java/com/b3dgs/lionengine/geom/Area.java b/lionengine-core/src/main/java/com/b3dgs/lionengine/geom/Area.java index 107ef0672..51d33f4d3 100644 --- a/lionengine-core/src/main/java/com/b3dgs/lionengine/geom/Area.java +++ b/lionengine-core/src/main/java/com/b3dgs/lionengine/geom/Area.java @@ -48,6 +48,17 @@ public interface Area extends Shape */ boolean contains(double x, double y); + /** + * Check if the area contains the point. + * + * @param point The point reference. + * @return true if contains, false else. + */ + default boolean contains(Point point) + { + return contains(point.getX(), point.getY()); + } + /** * Get the real width. *