MCPcopy
hub / github.com/EngoEngine/engo / AddByInterface

Method AddByInterface

common/mouse.go:164–167  ·  view source on GitHub ↗

AddByInterface adds the Entity to the system as long as it satisfies, Mouseable. Any Entity containing a BasicEntity,MouseComponent, and RenderComponent, automatically does this.

(i ecs.Identifier)

Source from the content-addressed store, hash-verified

162
163// AddByInterface adds the Entity to the system as long as it satisfies, Mouseable. Any Entity containing a BasicEntity,MouseComponent, and RenderComponent, automatically does this.
164func (m *MouseSystem) AddByInterface(i ecs.Identifier) {
165 o, _ := i.(Mouseable)
166 m.Add(o.GetBasicEntity(), o.GetMouseComponent(), o.GetSpaceComponent(), o.GetRenderComponent())
167}
168
169// Remove removes an entity from the MouseSystem.
170func (m *MouseSystem) Remove(basic ecs.BasicEntity) {

Callers

nothing calls this directly

Calls 5

AddMethod · 0.95
GetBasicEntityMethod · 0.80
GetMouseComponentMethod · 0.65
GetSpaceComponentMethod · 0.65
GetRenderComponentMethod · 0.65

Tested by

no test coverage detected