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)
|
2023-11-03 17:26:32 +08:00
|
|
|
err := LoadCiQC(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-09-28 14:34:00 +08:00
|
|
|
// 加载道岔相关实体
|
2023-11-03 17:26:32 +08:00
|
|
|
err = LoadTurnouts(w)
|
2023-09-28 14:34:00 +08:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-10-16 17:59:35 +08:00
|
|
|
// 加载信号机相关实体
|
|
|
|
err = LoadSignals(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-10-17 15:05:13 +08:00
|
|
|
// 加载车站实体
|
|
|
|
err = LoadStations(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-10-19 17:09:47 +08:00
|
|
|
// 加载屏蔽门相关实体
|
|
|
|
err = LoadPsd(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-10-23 17:39:39 +08:00
|
|
|
// 加载计轴区段相关实体
|
2023-11-01 11:08:24 +08:00
|
|
|
err = LoadAxlePhysicalSections(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-09-28 14:34:00 +08:00
|
|
|
return err
|
|
|
|
}
|