2023-09-27 18:39:18 +08:00
|
|
|
|
package rtss_simulation
|
|
|
|
|
|
2023-09-28 14:34:00 +08:00
|
|
|
|
import (
|
|
|
|
|
"joylink.club/ecs"
|
|
|
|
|
"joylink.club/rtsssimulation/entity"
|
|
|
|
|
"joylink.club/rtsssimulation/repository"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// 仿真循环间隔,单位ms
|
|
|
|
|
RtssSimulationTick = 20
|
|
|
|
|
)
|
|
|
|
|
|
2023-09-27 18:39:18 +08:00
|
|
|
|
// 初始化仿真
|
2023-09-28 14:34:00 +08:00
|
|
|
|
func NewSimulation(repo *repository.Repository) ecs.World {
|
|
|
|
|
w := ecs.NewWorld(RtssSimulationTick)
|
|
|
|
|
entity.Load(w, repo)
|
|
|
|
|
return w
|
|
|
|
|
}
|