22 lines
413 B
Go
22 lines
413 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 {
|
||
w := ecs.NewWorld(RtssSimulationTick)
|
||
sys.BindSystem(w)
|
||
entity.Load(w, repo)
|
||
return w
|
||
}
|