rtss-core/model/turnout.go

28 lines
386 B
Go
Raw Normal View History

2024-06-07 18:38:38 +08:00
package model
import (
"strings"
)
2024-06-17 19:45:38 +08:00
// 道岔
2024-06-07 18:38:38 +08:00
type Turnout interface {
2024-06-17 19:45:38 +08:00
PipeElement
}
2024-06-24 18:20:11 +08:00
var _ Turnout = (*TurnoutImpl)(nil)
2024-06-17 19:45:38 +08:00
type TurnoutImpl struct {
2024-06-27 19:59:13 +08:00
*ThreePortsPipeElement
2024-06-17 19:45:38 +08:00
}
2024-06-24 18:20:11 +08:00
func NewTurnout(uid string) *TurnoutImpl {
2024-06-17 19:45:38 +08:00
if strings.Trim(uid, " ") == "" {
panic("Turnout uid is empty")
}
return &TurnoutImpl{
2024-06-27 19:59:13 +08:00
ThreePortsPipeElement: &ThreePortsPipeElement{
uid: uid,
},
2024-06-17 19:45:38 +08:00
}
}