2023-09-06 16:20:36 +08:00
|
|
|
package repository
|
|
|
|
|
|
|
|
import "joylink.club/rtsssimulation/repository/model/proto"
|
|
|
|
|
|
|
|
type Slope struct {
|
|
|
|
Identity
|
|
|
|
|
2023-09-20 15:14:38 +08:00
|
|
|
kms []*proto.Kilometer
|
|
|
|
degree int32
|
|
|
|
startLinkPosition *LinkPosition
|
|
|
|
endLinkPosition *LinkPosition
|
2023-09-06 16:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewSlope(id string, kms []*proto.Kilometer, degree int32) *Slope {
|
|
|
|
return &Slope{
|
|
|
|
Identity: identity{id, proto.DeviceType_DeviceType_Slope},
|
|
|
|
kms: kms,
|
|
|
|
degree: degree,
|
|
|
|
}
|
|
|
|
}
|
2023-09-20 15:14:38 +08:00
|
|
|
|
|
|
|
func (s *Slope) bindStartLinkPosition(position *LinkPosition) {
|
|
|
|
s.startLinkPosition = position
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Slope) bindEndLinkPosition(position *LinkPosition) {
|
|
|
|
s.endLinkPosition = position
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Slope) StartLinkPosition() *LinkPosition {
|
|
|
|
return s.startLinkPosition
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Slope) EndLinkPosition() *LinkPosition {
|
|
|
|
return s.endLinkPosition
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Slope) Degree() int32 {
|
|
|
|
return s.degree
|
|
|
|
}
|