灯
This commit is contained in:
parent
da71326643
commit
9d66798163
22
component/Light.go
Normal file
22
component/Light.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package component
|
||||||
|
|
||||||
|
import "joylink.club/ecs"
|
||||||
|
|
||||||
|
// LightDrive 灯驱动
|
||||||
|
type LightDrive struct {
|
||||||
|
Td bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// 灯色标签
|
||||||
|
var (
|
||||||
|
LdTag = ecs.NewTag() //绿
|
||||||
|
HdTag = ecs.NewTag() //红
|
||||||
|
UdTag = ecs.NewTag() //黄
|
||||||
|
Bdtag = ecs.NewTag() //白
|
||||||
|
AdTag = ecs.NewTag() //蓝
|
||||||
|
)
|
||||||
|
|
||||||
|
// 组件
|
||||||
|
var (
|
||||||
|
LightDriveType = ecs.NewComponentType[LightDrive]()
|
||||||
|
)
|
5
entity/light.go
Normal file
5
entity/light.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package entity
|
||||||
|
|
||||||
|
func NewLightEntity() {
|
||||||
|
|
||||||
|
}
|
@ -43,9 +43,12 @@ func main() {
|
|||||||
worldLog(sim, "===>>亮灯 .....")
|
worldLog(sim, "===>>亮灯 .....")
|
||||||
fi.DriveSignal3XH1Dd(sim, IdSignal3XH1, true)
|
fi.DriveSignal3XH1Dd(sim, IdSignal3XH1, true)
|
||||||
//
|
//
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(2 * time.Second)
|
||||||
worldLog(sim, "===>>开通引导信号 .....")
|
worldLog(sim, "===>>开通引导信号 .....")
|
||||||
fi.DriveSignal3XH1Yx(sim, IdSignal3XH1)
|
fi.DriveSignal3XH1Yx(sim, IdSignal3XH1)
|
||||||
|
time.Sleep(2 * time.Second)
|
||||||
|
worldLog(sim, "===>>开通列车信号 .....")
|
||||||
|
fi.DriveSignal3XH1Lx(sim, IdSignal3XH1, true)
|
||||||
//
|
//
|
||||||
time.Sleep(3 * time.Second)
|
time.Sleep(3 * time.Second)
|
||||||
sim.Close()
|
sim.Close()
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit e7797346722a572814539d9a453789b89ffe6bf4
|
Subproject commit af605020f1bccf1f1b2ab5a4ae4966d1c6c9776c
|
Loading…
Reference in New Issue
Block a user