rts-sim-module/simulation/init.go

20 lines
394 B
Go
Raw Normal View History

2023-09-13 10:05:42 +08:00
package simulation
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/entities"
)
// 初始化仿真world
func InitializeWorld(config *WorldConfig) ecs.World {
world := ecs.NewWorld(config.Tick)
// 初始化系统
for _, sys := range config.Systems {
world.AddSystem(sys)
}
// 初始化系统时间
entities.CreateSystemTimerEntity(world, config.InitTime)
//
return world
}