rts-sim-module/repository/slope.go

41 lines
844 B
Go

package repository
import "joylink.club/rtsssimulation/repository/model/proto"
type Slope struct {
Identity
kms []*proto.Kilometer
degree int32
startLinkPosition *LinkPosition
endLinkPosition *LinkPosition
}
func NewSlope(id string, kms []*proto.Kilometer, degree int32) *Slope {
return &Slope{
Identity: identity{id, proto.DeviceType_DeviceType_Slope},
kms: kms,
degree: degree,
}
}
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
}