rts-sim-module/fi/signal_dcxh.go

34 lines
794 B
Go
Raw Normal View History

2023-10-09 17:13:16 +08:00
package fi
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
)
// signal dcxh 接口:开通调车信号、开通禁止信号
2023-10-09 17:58:29 +08:00
// DriveSignalDCXHDx 开通调车信号(白灯亮)
func DriveSignalDCXHDx(w ecs.World, signalId string) {
2023-10-09 17:13:16 +08:00
w.Execute(func() {
wd := entity.GetWorldData(w)
signalEntry, ok := wd.EntityMap[signalId]
if ok {
2023-10-12 16:59:08 +08:00
lsq := component.SignalDCXHLsqType.Get(signalEntry)
lsq.DCXH_DXJ_Q = true
2023-10-09 17:13:16 +08:00
}
})
}
2023-10-09 17:58:29 +08:00
// DriveSignalDCXHNon 开通禁止信号(蓝灯亮)
func DriveSignalDCXHNon(w ecs.World, signalId string) {
2023-10-09 17:13:16 +08:00
w.Execute(func() {
wd := entity.GetWorldData(w)
signalEntry, ok := wd.EntityMap[signalId]
if ok {
2023-10-12 16:59:08 +08:00
lsq := component.SignalDCXHLsqType.Get(signalEntry)
lsq.DCXH_DXJ_Q = false
2023-10-09 17:13:16 +08:00
}
})
}