MCPcopy Create free account
hub / github.com/EngoEngine/ecs / RemoveChild

Method RemoveChild

entity.go:74–85  ·  view source on GitHub ↗
(child *BasicEntity)

Source from the content-addressed store, hash-verified

72}
73
74func (e *BasicEntity) RemoveChild(child *BasicEntity) {
75 delete := -1
76 for i, v := range e.children {
77 if v.ID() == child.ID() {
78 delete = i
79 break
80 }
81 }
82 if delete >= 0 {
83 e.children = append(e.children[:delete], e.children[delete+1:]...)
84 }
85}
86
87// Children returns the children of the BasicEntity
88func (e *BasicEntity) Children() []BasicEntity {

Callers 1

TestRemoveChildFunction · 0.80

Calls 1

IDMethod · 0.65

Tested by 1

TestRemoveChildFunction · 0.64