aboutsummaryrefslogtreecommitdiff
path: root/pkg/field/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/field/utils.go')
-rw-r--r--pkg/field/utils.go5
1 files changed, 5 insertions, 0 deletions
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
+}