No title

Anonymous Coward 2018-03-03 21:54:58.372717 UTC

1func (entity *Entity) HasComponents(filters ...interface{}) bool {
2 for _, filter := range filters {
3 found := false
4 for _, component := range entity.Components {
5 if reflect.TypeOf(filter).Elem() == reflect.TypeOf(component) {
6 log.Println("Found")
7 // *filter = &component, my goal, but does not typecheck if I start messing with the function signature
8 found = true
9 break
10 }
11 }
12
13 if !found {
14 return false
15 }
16 }
17
18 return true
19}