23
23
//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
24
25
25
using System . Collections . Generic ;
26
+ using OpenBveApi . Interface ;
26
27
using OpenBveApi . Math ;
27
28
using OpenBveApi . Objects ;
28
29
using OpenBveApi . Routes ;
@@ -66,41 +67,20 @@ private class Station
66
67
internal double InterferenceInDoor ;
67
68
}
68
69
69
- private class FreeObj
70
+ private class FreeObj : AbstractStructure
70
71
{
71
- /// <summary>The track position of the object</summary>
72
- internal readonly double TrackPosition ;
73
- /// <summary>The routefile key of the object</summary>
74
- internal readonly string Key ;
75
- /// <summary>The X position of the object (m)</summary>
76
- internal readonly double X ;
77
- /// <summary>The Y position of the object (m)</summary>
78
- internal readonly double Y ;
79
- /// <summary>The Z position of the object (m)</summary>
80
- internal readonly double Z ;
81
72
/// <summary>The yaw of the object (radians)</summary>
82
73
internal readonly double Yaw ;
83
74
/// <summary>The pitch of the object (radians)</summary>
84
75
internal readonly double Pitch ;
85
76
/// <summary>The roll of the object (radians)</summary>
86
77
internal readonly double Roll ;
87
-
88
- internal readonly ObjectTransformType Type ;
89
-
90
- internal readonly double Span ;
91
-
92
- internal FreeObj ( double trackPosition , string key , double x , double y , double z , double yaw , double pitch , double roll , ObjectTransformType type , double span )
78
+
79
+ internal FreeObj ( double trackPosition , string key , Vector3 position , double yaw , double pitch , double roll , ObjectTransformType type , double span ) : base ( trackPosition , key , type , span , position )
93
80
{
94
- TrackPosition = trackPosition ;
95
- Key = key ;
96
- X = x ;
97
- Y = y ;
98
- Z = z ;
99
81
Yaw = yaw ;
100
82
Pitch = pitch ;
101
83
Roll = roll ;
102
- Type = type ;
103
- Span = span ;
104
84
}
105
85
}
106
86
@@ -113,12 +93,7 @@ private class Repeater
113
93
internal double EndingDistance ;
114
94
internal double Interval ;
115
95
internal string [ ] ObjectKeys ;
116
- /// <summary>The X position of the object (m)</summary>
117
- internal double X ;
118
- /// <summary>The Y position of the object (m)</summary>
119
- internal double Y ;
120
- /// <summary>The Z position of the object (m)</summary>
121
- internal double Z ;
96
+ internal Vector3 Position ;
122
97
/// <summary>The yaw of the object (radians)</summary>
123
98
internal double Yaw ;
124
99
/// <summary>The pitch of the object (radians)</summary>
@@ -136,20 +111,13 @@ internal Repeater(string key)
136
111
}
137
112
}
138
113
139
- private class Crack
114
+ private class Crack : AbstractStructure
140
115
{
141
- /// <summary>The track position of the object</summary>
142
- internal readonly double TrackPosition ;
143
- /// <summary>The routefile key of the object</summary>
144
- internal readonly string Key ;
145
-
146
116
internal readonly string PrimaryRail ;
147
117
internal readonly string SecondaryRail ;
148
118
149
- internal Crack ( string key , double trackPosition , string primaryRail , string secondaryRail )
119
+ internal Crack ( string key , double trackPosition , string primaryRail , string secondaryRail ) : base ( trackPosition , key , ObjectTransformType . FollowsGradient , 0 , Vector3 . Zero )
150
120
{
151
- Key = key ;
152
- TrackPosition = trackPosition ;
153
121
PrimaryRail = primaryRail ;
154
122
SecondaryRail = secondaryRail ;
155
123
}
@@ -162,19 +130,17 @@ private class Section
162
130
internal int DepartureStationIndex = - 1 ;
163
131
}
164
132
165
- private class Signal
133
+ private class Signal : AbstractStructure
166
134
{
167
- internal double TrackPosition ;
168
- internal string SignalObjectKey ;
169
- internal double X ;
170
- internal double Y ;
171
- internal double Z ;
172
135
internal double Yaw ;
173
136
internal double Pitch ;
174
137
internal double Roll ;
175
- internal ObjectTransformType Type ;
176
- internal double Span ;
177
138
internal int SectionIndex ;
139
+
140
+ internal Signal ( string key , double trackPosition , ObjectTransformType type , double span , Vector3 position ) : base ( trackPosition , key , type , span , position )
141
+ {
142
+
143
+ }
178
144
}
179
145
180
146
private class Transponder
0 commit comments