34 lines
794 B
Go
34 lines
794 B
Go
package fi
|
|
|
|
import (
|
|
"joylink.club/ecs"
|
|
"joylink.club/rtsssimulation/component"
|
|
"joylink.club/rtsssimulation/entity"
|
|
)
|
|
|
|
// signal dcxh 接口:开通调车信号、开通禁止信号
|
|
|
|
// DriveSignalDCXHDx 开通调车信号(白灯亮)
|
|
func DriveSignalDCXHDx(w ecs.World, signalId string) {
|
|
w.Execute(func() {
|
|
wd := entity.GetWorldData(w)
|
|
signalEntry, ok := wd.EntityMap[signalId]
|
|
if ok {
|
|
lsq := component.SignalDCXHLsqType.Get(signalEntry)
|
|
lsq.DCXH_DXJ_Q = true
|
|
}
|
|
})
|
|
}
|
|
|
|
// DriveSignalDCXHNon 开通禁止信号(蓝灯亮)
|
|
func DriveSignalDCXHNon(w ecs.World, signalId string) {
|
|
w.Execute(func() {
|
|
wd := entity.GetWorldData(w)
|
|
signalEntry, ok := wd.EntityMap[signalId]
|
|
if ok {
|
|
lsq := component.SignalDCXHLsqType.Get(signalEntry)
|
|
lsq.DCXH_DXJ_Q = false
|
|
}
|
|
})
|
|
}
|