package engine import ( "fmt" "net" "github.com/EngoEngine/ecs" ) type RenderComponent struct { Color bool } func (rc *RenderComponent) GetRenderComponent() *RenderComponent { return rc } type RenderComponentInterface interface { ecs.BasicFace GetRenderComponent() *RenderComponent } type DemoEntity struct { ecs.BasicEntity *RenderComponent } type TELNETRenderSystem struct { entities map[uint64]RenderComponentInterface conns map[uint64]net.Conn } func Priority() int { return 100 } func New(w *ecs.World) { } func (trs *TELNETRenderSystem) AddByInterface(o ecs.Identifier) { fmt.Println("calling AddByInterface") v := o.(RenderComponentInterface) trs.entities[o.ID()] = v } func (trs TELNETRenderSystem) Update(dt float32) { for _, e := range trs.entities { fmt.Println("bing bong", e) } } func (trs TELNETRenderSystem) Remove(e ecs.BasicEntity) { }