rts-sim-module/init.go

22 lines
434 B
Go
Raw Normal View History

package rtss_simulation
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/entity"
"joylink.club/rtsssimulation/repository"
"joylink.club/rtsssimulation/sys"
)
const (
// 仿真循环间隔单位ms
RtssSimulationTick = 20
)
// 初始化仿真
func NewSimulation(repo *repository.Repository) (ecs.World, error) {
w := ecs.NewWorld(RtssSimulationTick)
sys.BindSystem(w)
err := entity.Load(w, repo)
return w, err
}