@@ -73,22 +73,47 @@ public static class Utilities
73
73
74
74
public const float SECONDS_PER_MINUTE = 60.0f ;
75
75
76
+ /// <summary>
77
+ /// Convert a tick to a 2D/3D position.
78
+ /// </summary>
79
+ ///
80
+ /// <param name="tick">The tick.</param>
81
+ /// <param name="resolution">The resolution of the song.</param>
76
82
public static float ConvertTickToPosition ( float tick , int resolution )
77
83
{
78
84
return UtilitiesInternal . ConvertTickToPosition ( tick , resolution ) ;
79
85
}
80
86
87
+ /// <summary>
88
+ /// Convert seconds to ticks.
89
+ /// </summary>
90
+ ///
91
+ /// <param name="seconds">The seconds to generate ticks with.</param>
92
+ /// <param name="resolution">The resolution of the song.</param>
93
+ /// <param name="bpmChanges">All BPM changes within the song.</param>
81
94
public static int ConvertSecondsToTicks ( float seconds , int resolution , Dictionary < int , int > bpmChanges )
82
95
{
83
96
return UtilitiesInternal . ConvertSecondsToTicksInternal ( seconds , resolution , bpmChanges . Keys . ToArray ( ) ,
84
97
bpmChanges . Values . ToArray ( ) , bpmChanges . Count ) ;
85
98
}
86
99
100
+ /// <summary>
101
+ /// Checks to see if the current time of a game or audio file is on the beat.
102
+ /// </summary>
103
+ ///
104
+ /// <param name="bpm">The base BPM for a song.</param>
105
+ /// <param name="currentTime">A timestamp to compare to the BPM.</param>
87
106
public static bool IsOnTheBeat ( float bpm , float currentTime )
88
107
{
89
108
return UtilitiesInternal . IsOnTheBeat ( bpm , currentTime ) ;
90
109
}
91
110
111
+ /// <summary>
112
+ /// Rounds a value up the nearest multiplier.
113
+ /// </summary>
114
+ ///
115
+ /// <param name="value">The value to round.</param>
116
+ /// <param name="multiplier">The multiplier to round using.</param>
92
117
public static int RoundUpToTheNearestMultiplier ( int value , int multiplier )
93
118
{
94
119
return UtilitiesInternal . RoundUpToTheNearestMultiplier ( value , multiplier ) ;
@@ -146,6 +171,13 @@ public static List<BeatBar> CalculateBeatBars(Dictionary<int, int> bpmChanges, i
146
171
return null ;
147
172
}
148
173
174
+ /// <summary>
175
+ /// Calculated the accuracy ratio of the current position against a static position.
176
+ /// </summary>
177
+ ///
178
+ /// <param name="position">The position to test against.</param>
179
+ /// <param name="currentPosition">The current position.</param>
180
+ /// <param name="delta">The plus/minus delta to test the current position against.</param>
149
181
public static float CalculateAccuracyRatio ( int position , int currentPosition , int delta = 50 )
150
182
{
151
183
return UtilitiesInternal . CalculateAccuracyRatio ( position , currentPosition , delta ) ;
0 commit comments