2023-09-28 14:34:00 +08:00
|
|
|
package entity
|
|
|
|
|
|
|
|
import (
|
|
|
|
"joylink.club/ecs"
|
|
|
|
"joylink.club/rtsssimulation/repository"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 仿真实体加载
|
|
|
|
func Load(w ecs.World, repo *repository.Repository) error {
|
|
|
|
// 初始化世界数据单例组件
|
|
|
|
LoadWorldData(w, repo)
|
|
|
|
// 加载道岔相关实体
|
|
|
|
err := LoadTurnouts(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-10-12 17:55:40 +08:00
|
|
|
// 加载屏蔽门相关实体
|
|
|
|
err = LoadPsd(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-10-16 17:59:35 +08:00
|
|
|
// 加载信号机相关实体
|
|
|
|
err = LoadSignals(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-09-28 14:34:00 +08:00
|
|
|
return err
|
|
|
|
}
|