|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package systems
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"log/slog"
|
|
|
|
|
|
|
|
|
|
"github.com/EngoEngine/ecs"
|
|
|
|
|
@ -16,7 +17,8 @@ type Room struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type RoomSystem struct {
|
|
|
|
|
L *slog.Logger
|
|
|
|
|
L *slog.Logger
|
|
|
|
|
// replace this with cache fronted db access later
|
|
|
|
|
Rooms map[uint64]*Room
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -33,20 +35,26 @@ func (rs *RoomSystem) New(w *ecs.World) {
|
|
|
|
|
X: int64(i),
|
|
|
|
|
Y: int64(j),
|
|
|
|
|
},
|
|
|
|
|
Observable: &components.Observable{},
|
|
|
|
|
Inventory: &components.Inventory{},
|
|
|
|
|
Observable: &components.Observable{
|
|
|
|
|
Name: fmt.Sprintf("Room (%d,%d)", i, j),
|
|
|
|
|
Description: fmt.Sprintf("%s", "A non-descript room."),
|
|
|
|
|
},
|
|
|
|
|
Inventory: &components.Inventory{},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rs.L.With(
|
|
|
|
|
slog.Int("X", i),
|
|
|
|
|
slog.Int("Y", j),
|
|
|
|
|
slog.Int("ID", z),
|
|
|
|
|
).Debug("loaded room")
|
|
|
|
|
z++
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// locationMapper := ecs.NewMap4[ID, Location, Observable, Inventory](w)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (rs *RoomSystem) Update(dt float32) {
|
|
|
|
|
rs.L.Debug("room system tick")
|
|
|
|
|
|
|
|
|
|
// flush changes to persistent storage
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (rs *RoomSystem) Remove(e ecs.BasicEntity) {}
|
|
|
|
|
|
|
|
|
|
// Finalize the system.
|
|
|
|
|
func (rs *RoomSystem) Finalize(w *ecs.World) {}
|
|
|
|
|
|