diff options
author | Julien Dessaux | 2021-09-19 01:10:52 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-09-19 01:10:52 +0200 |
commit | 0c52da671406d7881226ce28b29fe4eb0b36c8bc (patch) | |
tree | 71bf9c875e7a4bb447e7a0dbb829752f30e9a010 /pkg/field/utils.go | |
parent | Added function to calculate a next pointer step on the field (diff) | |
download | gofunge98-0c52da671406d7881226ce28b29fe4eb0b36c8bc.tar.gz gofunge98-0c52da671406d7881226ce28b29fe4eb0b36c8bc.tar.bz2 gofunge98-0c52da671406d7881226ce28b29fe4eb0b36c8bc.zip |
Moved isIn function to a util file
Diffstat (limited to '')
-rw-r--r-- | pkg/field/utils.go | 5 |
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 +} |