2023-10-18 13:53:17 +08:00
|
|
|
package memory
|
|
|
|
|
|
|
|
import (
|
2023-10-26 17:16:07 +08:00
|
|
|
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
|
2023-10-18 13:53:17 +08:00
|
|
|
"joylink.club/rtsssimulation/fi"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 操作IBP按钮
|
2023-11-06 14:30:09 +08:00
|
|
|
func ChangeIBPButtonState(sim *VerifySimulation, mapId int32, stationId, btnCode string, pressDown bool) error {
|
2023-10-20 13:50:22 +08:00
|
|
|
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
|
2023-10-18 13:53:17 +08:00
|
|
|
if pressDown {
|
2023-11-06 14:30:09 +08:00
|
|
|
return fi.PressDownButton(sim.World, stationUid+"_button_"+btnCode)
|
2023-10-18 13:53:17 +08:00
|
|
|
} else {
|
2023-11-06 14:30:09 +08:00
|
|
|
return fi.PressUpButton(sim.World, stationUid+"_button_"+btnCode)
|
2023-10-18 13:53:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-20 13:50:22 +08:00
|
|
|
// 操作IBP按钮
|
2023-11-06 14:30:09 +08:00
|
|
|
func ChangeIBPKeyState(sim *VerifySimulation, mapId int32, stationId, keyCode string, gear int32) error {
|
2023-10-20 13:50:22 +08:00
|
|
|
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
|
2023-11-06 14:30:09 +08:00
|
|
|
return fi.SwitchKeyGear(sim.World, stationUid+"_key_"+keyCode, gear)
|
2023-10-20 13:50:22 +08:00
|
|
|
}
|