Add some memory reading stuff, based on many other open source projects

This commit is contained in:
Héctor Giménez
2023-03-11 22:08:18 +09:00
parent 80b4732f38
commit dde3cd19b0
16 changed files with 1056 additions and 6 deletions

13
pkg/utils/utils.go Normal file
View File

@@ -0,0 +1,13 @@
package utils
import (
"github.com/hectorgimenez/d2go/pkg/data"
"math"
)
func DistanceFromPoint(from data.Position, to data.Position) int {
first := math.Pow(float64(to.X-from.X), 2)
second := math.Pow(float64(to.Y-from.Y), 2)
return int(math.Sqrt(first + second))
}