From 0c52da671406d7881226ce28b29fe4eb0b36c8bc Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 19 Sep 2021 01:10:52 +0200 Subject: Moved isIn function to a util file --- pkg/field/utils.go | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 pkg/field/utils.go (limited to 'pkg/field/utils.go') diff --git a/pkg/field/utils.go b/pkg/field/utils.go new file mode 100644 index 0000000..79a191b --- /dev/null +++ b/pkg/field/utils.go @@ -0,0 +1,5 @@ +package field + +func (f Field) isIn(x, y int) bool { + return x >= f.x && x < f.x+f.lx && y >= f.y && y < f.y+f.ly +} -- cgit v1.2.3