rts-sim-module/component/singleton/repo.go

20 lines
339 B
Go
Raw Normal View History

package singleton
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/modelrepo"
)
var WorldRepoType = ecs.NewComponentType[WorldRepo]()
type WorldRepo struct {
r modelrepo.Repo
}
func loadWorldRepo(w ecs.World, r modelrepo.Repo) {
entry := w.Entry(w.Create(WorldRepoType))
WorldRepoType.Set(entry, &WorldRepo{
r: r,
})
}