22 lines
434 B
Go
22 lines
434 B
Go
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
|
||
}
|