rts-sim-module/deprecated/test1/tinit/init.go
walker 0bba8f0934 删除donburi包引用
修改filter导入为从ecs项目导入
整理包结构,将弃用的包放入deprecated文件中
2023-10-09 11:17:25 +08:00

26 lines
655 B
Go

package tinit
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/deprecated/entities"
"joylink.club/rtsssimulation/deprecated/system"
)
// InitializeWorld 初始化仿真world
func InitializeWorld(config *WorldConfig) ecs.World {
world := ecs.NewWorld(config.Tick)
// 添加系统
world.AddSystem(system.NewTimerSystem())
world.AddSystem(system.NewPercentageMovableSystem())
for _, sys := range config.Systems {
world.AddSystem(sys)
}
// 添加内置实体
entities.CreateSystemTimerEntity(world, config.InitTime)
if config.ModelManager != nil {
entities.CreateModelStorageEntity(world, config.ModelManager)
}
//
return world
}