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

Method AddByInterface

common/collision.go:537–540  ·  view source on GitHub ↗

AddByInterface Provides a simple way to add an entity to the system that satisfies Collisionable. Any entity containing, BasicEntity,CollisionComponent, and SpaceComponent anonymously, automatically does this.

(i ecs.Identifier)

Source from the content-addressed store, hash-verified

535
536// AddByInterface Provides a simple way to add an entity to the system that satisfies Collisionable. Any entity containing, BasicEntity,CollisionComponent, and SpaceComponent anonymously, automatically does this.
537func (c *CollisionSystem) AddByInterface(i ecs.Identifier) {
538 o, _ := i.(Collisionable)
539 c.Add(o.GetBasicEntity(), o.GetCollisionComponent(), o.GetSpaceComponent())
540}
541
542// Remove removes an entity from the CollisionSystem.
543func (c *CollisionSystem) Remove(basic ecs.BasicEntity) {

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
GetBasicEntityMethod · 0.80
GetCollisionComponentMethod · 0.65
GetSpaceComponentMethod · 0.65

Tested by

no test coverage detected