use gogues ecs, not working, needs rethinking

This commit is contained in:
2019-11-04 19:07:16 +03:00
parent fd27dfd636
commit f9ebcefc86
13 changed files with 490 additions and 33 deletions

25
engine/ecs/util.go Normal file
View File

@ -0,0 +1,25 @@
package ecs
// ECS system by jcerise, github.com/jcerise/gogue
import "reflect"
// IntInSlice will return true if the integer value provided is present in the slice provided, false otherwise.
func IntInSlice(a int, list []int) bool {
for _, b := range list {
if b == a {
return true
}
}
return false
}
// TypeInSlice will return true if the reflect.Type provided is present in the slice provided, false otherwise.
func TypeInSlice(a reflect.Type, list []reflect.Type) bool {
for _, b := range list {
if b == a {
return true
}
}
return false
}