You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
889 B
Go
55 lines
889 B
Go
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) {
|
|
|
|
}
|