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

Method Remove

entity_test.go:112–122  ·  view source on GitHub ↗
(e BasicEntity)

Source from the content-addressed store, hash-verified

110 }
111}
112func (sys *MySystemTwo) Remove(e BasicEntity) {
113 delete := -1
114 for index, entity := range sys.entities {
115 if entity.e.ID() == e.ID() {
116 delete = index
117 }
118 }
119 if delete >= 0 {
120 sys.entities = append(sys.entities[:delete], sys.entities[delete+1:]...)
121 }
122}
123func (sys *MySystemTwo) Add(e *BasicEntity, c2 *MyComponent2) {
124 sys.entities = append(sys.entities, MySystemTwoEntity{e, c2})
125}

Callers

nothing calls this directly

Calls 1

IDMethod · 0.65

Tested by

no test coverage detected