model and component adjustment

This commit is contained in:
soul-walker 2024-06-14 16:56:55 +08:00
parent 2dba440168
commit 74d0141087
2 changed files with 34 additions and 2 deletions

View File

@ -1,6 +1,13 @@
package component package component
// 道岔驱采组件 import "joylink.club/ecs"
var (
TurnoutQcType = ecs.NewComponentType[TurnoutQc]()
LimitMotorType = ecs.NewComponentType[LimitMotor]()
)
// 道岔驱采状态
type TurnoutQc struct { type TurnoutQc struct {
CJ bool CJ bool
DCJ bool DCJ bool
@ -9,7 +16,7 @@ type TurnoutQc struct {
FBJ bool FBJ bool
} }
// 限位电机组件 // 限位电机状态
type LimitMotor struct { type LimitMotor struct {
Min int Min int
Max int Max int

View File

@ -4,3 +4,28 @@ type RtssModel interface {
// RtssModel unique id // RtssModel unique id
Uid() string Uid() string
} }
// 轨道端口
type PipePort = string
var (
// PipePortA 轨道端口A
PipePortA PipePort = "A"
// PipePortB 轨道端口B
PipePortB PipePort = "B"
// PipePortC 轨道端口C
PipePortC PipePort = "C"
)
type PipeLink struct {
// 轨道
Pipe Pipe
// 端口
Port PipePort
}
// 轨道
type Pipe interface {
// 获取指定端口连接的下一个轨道及端口
Next(port PipePort) PipeLink
}