2023-09-28 14:34:00 +08:00
|
|
|
package entity
|
|
|
|
|
|
|
|
import (
|
|
|
|
"joylink.club/ecs"
|
2024-01-05 14:07:43 +08:00
|
|
|
"joylink.club/rtsssimulation/component/singleton"
|
2023-09-28 14:34:00 +08:00
|
|
|
"joylink.club/rtsssimulation/repository"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 仿真实体加载
|
|
|
|
func Load(w ecs.World, repo *repository.Repository) error {
|
|
|
|
// 初始化世界数据单例组件
|
2024-01-05 14:07:43 +08:00
|
|
|
singleton.LoadWorldTime(w)
|
2023-09-28 14:34:00 +08:00
|
|
|
LoadWorldData(w, repo)
|
2023-11-06 17:32:34 +08:00
|
|
|
// 加载联锁驱采卡相关实体
|
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-11-23 13:17:09 +08:00
|
|
|
// 加载应答器
|
|
|
|
err = LoadBalises(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2024-03-07 17:40:51 +08:00
|
|
|
// 加载车库门
|
|
|
|
err = LoadCkm(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2024-03-08 17:11:53 +08:00
|
|
|
//加载洗车机
|
|
|
|
err = LoadXcj(w)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-09-28 14:34:00 +08:00
|
|
|
return err
|
|
|
|
}
|