aboutsummaryrefslogtreecommitdiff
path: root/pkg/field/utils.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-09-19 01:10:52 +0200
committerJulien Dessaux2021-09-19 01:10:52 +0200
commit0c52da671406d7881226ce28b29fe4eb0b36c8bc (patch)
tree71bf9c875e7a4bb447e7a0dbb829752f30e9a010 /pkg/field/utils.go
parentAdded function to calculate a next pointer step on the field (diff)
downloadgofunge98-0c52da671406d7881226ce28b29fe4eb0b36c8bc.tar.gz
gofunge98-0c52da671406d7881226ce28b29fe4eb0b36c8bc.tar.bz2
gofunge98-0c52da671406d7881226ce28b29fe4eb0b36c8bc.zip
Moved isIn function to a util file
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
+}