ecs attempt
This commit is contained in:
@ -18,9 +18,10 @@ func (m *Mob) Walk(level *gamemap.Level, dx, dy int) {
|
||||
if level.GetTile(newCoords).BlocksPass {
|
||||
return
|
||||
}
|
||||
if level.Objects.At(newCoords).HasComponent("block_pass") {
|
||||
|
||||
}
|
||||
//fixme
|
||||
//if level.Objects.At(newCoords).HasComponent("block_pass") {
|
||||
//
|
||||
//}
|
||||
fmt.Printf("new coords: %d, %d\n", m.Coords.X, m.Coords.Y)
|
||||
}
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
package mob
|
||||
|
||||
import (
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/ecs"
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/types"
|
||||
)
|
||||
|
||||
type MobRenderSystem struct {
|
||||
EntityController *ecs.Controller
|
||||
}
|
||||
|
||||
func (mrs MobRenderSystem) Process(){
|
||||
for e := range mrs.EntityController.GetEntities() {
|
||||
if mrs.EntityController.HasComponent(e, types.Coords{}.TypeOf()) &&
|
||||
mrs.EntityController.HasComponent(e, types.Appearance{}.TypeOf()) {
|
||||
|
||||
pos := mrs.EntityController.GetComponent(e, types.Coords{}.TypeOf()).(types.Coords)
|
||||
appearance := mrs.EntityController.GetComponent(e, types.Appearance{}.TypeOf()).(types.Appearance)
|
||||
|
||||
// Clear the cell this entity occupies, so it is the only glyph drawn there
|
||||
for i := 0; i <= 2; i++ {
|
||||
//fixme
|
||||
gogue.ClearArea(pos.X, pos.Y, 1, 1, i)
|
||||
}
|
||||
//fixme
|
||||
gogue.PrintGlyph(pos.X, pos.Y, appearance.Glyph, "", appearance.Layer)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user