obstacle collission added, but not working yet

This commit is contained in:
2024-02-20 18:47:32 +01:00
parent fd570216f0
commit 646b227b8e
15 changed files with 112 additions and 21 deletions

View File

@@ -1,5 +1,9 @@
package util
import (
. "openquell/config"
)
// find an item in a list, generic variant
func Contains[E comparable](s []E, v E) bool {
for _, vs := range s {
@@ -19,3 +23,21 @@ func Exists[K comparable, V any](m map[K]V, v K) bool {
return false
}
func DirectionStr(dir int) string {
str := "Stop"
switch dir {
case East:
str = "East"
case West:
str = "West"
case South:
str = "South"
case North:
str = "North"
case All:
str = "All"
}
return str
}