@@ -91,20 +91,20 @@ namespace RTE {
91
91
// / This is when the timer is supposed to show that it has 'expired' or reached whatever time limit it is supposed to keep track of.
92
92
// / </summary>
93
93
// / <returns>A positive double with the real time limit relative to the start time.</returns>
94
- double GetRealTimeLimitS () const { return m_RealTimeLimit / ( double ) g_TimerMan.GetTicksPerSecond (); }
94
+ double GetRealTimeLimitS () const { return m_RealTimeLimit / static_cast < double >( g_TimerMan.GetTicksPerSecond () ); }
95
95
96
96
// / <summary>
97
97
// / Sets the real time limit value of this Timer, RELATVE to the start time.
98
98
// / This is when the timer is supposed to show that it has 'expired' or reached whatever time limit it is supposed to keep track of.
99
99
// / </summary>
100
100
// / <param name="newTimeLimit">A positive double with the new real time limit relative to the start time.</param>
101
- void SetRealTimeLimitS (double newTimeLimit) { m_RealTimeLimit = newTimeLimit * ( double ) g_TimerMan.GetTicksPerSecond (); }
101
+ void SetRealTimeLimitS (double newTimeLimit) { m_RealTimeLimit = newTimeLimit * static_cast < double >( g_TimerMan.GetTicksPerSecond () ); }
102
102
103
103
// / <summary>
104
104
// / Gets the elapsed real time in ms since this Timer was Reset().
105
105
// / </summary>
106
106
// / <returns>A unsigned long value that represents the elapsed real time since Reset() in ms.</returns>
107
- double GetElapsedRealTimeMS () const { return ( double ) (g_TimerMan.GetRealTickCount () - m_StartRealTime) / m_TicksPerMS; }
107
+ double GetElapsedRealTimeMS () const { return static_cast < double > (g_TimerMan.GetRealTickCount () - m_StartRealTime) / m_TicksPerMS; }
108
108
109
109
// / <summary>
110
110
// / Sets the start real time value of this Timer, in seconds.
@@ -116,13 +116,13 @@ namespace RTE {
116
116
// / Gets the elapsed real time in seconds since this Timer was Reset().
117
117
// / </summary>
118
118
// / <returns>A double value that represents the elapsed real time since Reset() in s.</returns>
119
- double GetElapsedRealTimeS () const { return ( double ) (g_TimerMan.GetRealTickCount () - m_StartRealTime) / ( double ) g_TimerMan.GetTicksPerSecond (); }
119
+ double GetElapsedRealTimeS () const { return static_cast < double > (g_TimerMan.GetRealTickCount () - m_StartRealTime) / static_cast < double >( g_TimerMan.GetTicksPerSecond () ); }
120
120
121
121
// / <summary>
122
122
// / Sets the start real time value of this Timer.
123
123
// / </summary>
124
124
// / <param name="newElapsedRealTime">An int64 with the new elapsed time value in seconds.</param>
125
- void SetElapsedRealTimeS (const double newElapsedRealTime) { m_StartRealTime = g_TimerMan.GetRealTickCount () - (newElapsedRealTime * ( double ) g_TimerMan.GetTicksPerSecond ()); }
125
+ void SetElapsedRealTimeS (const double newElapsedRealTime) { m_StartRealTime = g_TimerMan.GetRealTickCount () - (newElapsedRealTime * static_cast < double >( g_TimerMan.GetTicksPerSecond () )); }
126
126
127
127
// / <summary>
128
128
// / Returns how much time in ms that there is left till this Timer reaches a certain time limit.
@@ -148,7 +148,7 @@ namespace RTE {
148
148
// / Returns how much time in ms that there is left till this Timer reaches a certain time limit previously set by SetRealTimeLimitS.
149
149
// / </summary>
150
150
// / <returns>A unsigned long with the real time left till the passed in value, or negative if this Timer is already past that point in time.</returns>
151
- double LeftTillRealTimeLimitS () { return (m_RealTimeLimit * ( double ) g_TimerMan.GetTicksPerSecond ()) - GetElapsedRealTimeS (); }
151
+ double LeftTillRealTimeLimitS () { return (m_RealTimeLimit * static_cast < double >( g_TimerMan.GetTicksPerSecond () )) - GetElapsedRealTimeS (); }
152
152
153
153
// / <summary>
154
154
// / Returns true if the elapsed real time is past a certain amount of time after the start previously set by SetRealTimeLimit.
@@ -169,7 +169,7 @@ namespace RTE {
169
169
// / </summary>
170
170
// / <param name="period">An int with the alternating period in ms. The time specified here is how long it will take for the switch to alternate.</param>
171
171
// / <returns>Whether the elapsed time is in the first state or not.</returns>
172
- bool AlternateReal (int period) const { return (( int ) GetElapsedRealTimeMS () % (period * 2 )) > period; }
172
+ bool AlternateReal (int period) const { return (static_cast < int >( GetElapsedRealTimeMS () ) % (period * 2 )) > period; }
173
173
#pragma endregion
174
174
175
175
#pragma region Simulation Time
@@ -204,20 +204,20 @@ namespace RTE {
204
204
// / This is when the timer is supposed to show that it has 'expired' or reached whatever time limit it is supposed to keep track of.
205
205
// / </summary>
206
206
// / <returns>A positive double with the sim time limit relative to the start time.</returns>
207
- double GetSimTimeLimitS () const { return m_SimTimeLimit / ( double ) g_TimerMan.GetTicksPerSecond (); }
207
+ double GetSimTimeLimitS () const { return m_SimTimeLimit / static_cast < double >( g_TimerMan.GetTicksPerSecond () ); }
208
208
209
209
// / <summary>
210
210
// / Sets the sim time limit value of this Timer, RELATVE to the start time.
211
211
// / This is when the timer is supposed to show that it has 'expired' or reached whatever time limit it is supposed to keep track of.
212
212
// / </summary>
213
213
// / <param name="newTimeLimit">A positive double with the new sim time limit relative to the start time.</param>
214
- void SetSimTimeLimitS (double newTimeLimit) { m_SimTimeLimit = newTimeLimit * ( double ) g_TimerMan.GetTicksPerSecond (); }
214
+ void SetSimTimeLimitS (double newTimeLimit) { m_SimTimeLimit = newTimeLimit * static_cast < double >( g_TimerMan.GetTicksPerSecond () ); }
215
215
216
216
// / <summary>
217
217
// / Gets the elapsed time in ms since this Timer was Reset().
218
218
// / </summary>
219
219
// / <returns>A unsigned long value that represents the elapsed time since Reset() in ms.</returns>
220
- double GetElapsedSimTimeMS () const { return ( double ) (g_TimerMan.GetSimTickCount () - m_StartSimTime) / m_TicksPerMS; }
220
+ double GetElapsedSimTimeMS () const { return static_cast < double > (g_TimerMan.GetSimTickCount () - m_StartSimTime) / m_TicksPerMS; }
221
221
222
222
// / <summary>
223
223
// / Sets the start time value of this Timer, in ms.
@@ -229,13 +229,13 @@ namespace RTE {
229
229
// / Gets the elapsed time in s since this Timer was Reset().
230
230
// / </summary>
231
231
// / <returns>A unsigned long value that represents the elapsed time since Reset() in s.</returns>
232
- double GetElapsedSimTimeS () const { return ( double ) (g_TimerMan.GetSimTickCount () - m_StartSimTime) / ( double ) g_TimerMan.GetTicksPerSecond (); }
232
+ double GetElapsedSimTimeS () const { return static_cast < double > (g_TimerMan.GetSimTickCount () - m_StartSimTime) / static_cast < double >( g_TimerMan.GetTicksPerSecond () ); }
233
233
234
234
// / <summary>
235
235
// / Sets the start time value of this Timer, in seconds.
236
236
// / </summary>
237
237
// / <param name="newElapsedSimTime">An int64 with the new elapsed time value in seconds.</param>
238
- void SetElapsedSimTimeS (const double newElapsedSimTime) { m_StartSimTime = g_TimerMan.GetSimTickCount () - (newElapsedSimTime * ( double ) g_TimerMan.GetTicksPerSecond ()); }
238
+ void SetElapsedSimTimeS (const double newElapsedSimTime) { m_StartSimTime = g_TimerMan.GetSimTickCount () - (newElapsedSimTime * static_cast < double >( g_TimerMan.GetTicksPerSecond () )); }
239
239
240
240
// / <summary>
241
241
// / Returns how much time in ms that there is left till this Timer reaches a certain time limit.a certain time limit.
@@ -261,7 +261,7 @@ namespace RTE {
261
261
// / Returns how much time in ms that there is left till this Timer reaches a certain time limit previously set by SetSimTimeLimitS.
262
262
// / </summary>
263
263
// / <returns>A unsigned long with the sim time left till the passed in value, or negative if this Timer is already past that point in time.</returns>
264
- double LeftTillSimTimeLimitS () const { return (m_SimTimeLimit * ( double ) g_TimerMan.GetTicksPerSecond ()) - GetElapsedSimTimeS (); }
264
+ double LeftTillSimTimeLimitS () const { return (m_SimTimeLimit * static_cast < double >( g_TimerMan.GetTicksPerSecond () )) - GetElapsedSimTimeS (); }
265
265
266
266
// / <summary>
267
267
// / Returns true if the elapsed sim time is past a certain amount of time after the start previously set by SetSimTimeLimit.
@@ -282,7 +282,7 @@ namespace RTE {
282
282
// / </summary>
283
283
// / <param name="period">An int with the alternating period in ms. The time specified here is how long it will take for the switch to alternate.</param>
284
284
// / <returns>Whether the elapsed time is in the first state or not.</returns>
285
- bool AlternateSim (int period) const { if (period == 0 ) return true ; else return (( int ) GetElapsedSimTimeMS () % (period * 2 )) > period; }
285
+ bool AlternateSim (int period) const { return (period == 0 ) ? true : ( static_cast < int >( GetElapsedSimTimeMS () ) % (period * 2 )) > period; }
286
286
#pragma endregion
287
287
288
288
#pragma region Class Info
0 commit comments