EDIT: I now finished the system. It's pretty optimized and works fine. Maybe someone can move this to the repository? Inside the demomap is a little documentation on how to implement.
Hey,
I recentely made a system for fun. The user specifies a number of points in a specific order. The game then connects the given points using the order to make a figure. You can make a triangle, a square, or something complicated. The system can now check if a given point is within the figure. So: the user gives the system a point to check, and a number of points that compose a figure, then the system returns either true or false.
I attached some screenshots for clarification.

When outside of the figure the peasant is red.

Inside of the figure the peasant is green.

Green.

Red.
Included is a demo map from which I made the screenshots. You can move any of the peasants to make a figure of your own.