43 lines
550 B
Go
43 lines
550 B
Go
package model
|
|
|
|
import "joylink.club/rtsssimulation/repository/model/proto"
|
|
|
|
type Link struct {
|
|
Model
|
|
|
|
aRelation LinkNodePort
|
|
bRelation LinkNodePort
|
|
}
|
|
|
|
func NewLink(model Model) Link {
|
|
return Link{Model: model}
|
|
}
|
|
|
|
// link位置
|
|
type LinkPosition struct {
|
|
link *Link
|
|
offset int
|
|
}
|
|
|
|
// link节点
|
|
type LinkNode struct {
|
|
turnout *Turnout
|
|
aRelation LinkPort
|
|
bRelation LinkPort
|
|
cRelation LinkPort
|
|
}
|
|
|
|
type LinkPort struct {
|
|
DevicePort
|
|
|
|
link *Link
|
|
port proto.Port
|
|
}
|
|
|
|
type LinkNodePort struct {
|
|
DevicePort
|
|
|
|
node *LinkNode
|
|
port proto.Port
|
|
}
|