11//MIT License
22
3- //Copyright (c) 2024-2024 Peter Kirmeier
3+ //Copyright (c) 2024-2025 Peter Kirmeier
44
55//Permission is hereby granted, free of charge, to any person obtaining a copy
66//of this software and associated documentation files (the "Software"), to deal
2020//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121//SOFTWARE.
2222
23- using System . Reflection ;
2423using System ;
25- using System . IO ;
24+ using System . Collections . Generic ;
2625using System . Collections . ObjectModel ;
26+ using System . IO ;
27+ using System . Reflection ;
2728using static HitCounterManager . IAutoSplitterCoreInterface ;
2829
2930namespace HitCounterManager
@@ -39,32 +40,67 @@ public interface IAutoSplitterCoreInterface
3940 int ActiveGameIndex { get ; set ; }
4041
4142 /// <summary>
42- /// ????
43+ /// Gets or sets the ASC practice mode activation (no automatic splitting).
4344 /// </summary>
4445 bool PracticeMode { get ; set ; }
4546
47+ /// <summary>
48+ /// Gets or sets the currently selected profile name.
49+ /// </summary>
50+ string ProfileName { get ; set ; }
51+
52+ /// <summary>
53+ /// Gets all profile names.
54+ /// </summary>
55+ /// <returns></returns>
56+ List < string > ProfileNames { get ; }
57+
58+ /// <summary>
59+ /// Create a profile with the given new name and select it.
60+ /// </summary>
61+ /// <param name="NewName">Name of the new profile</param>
62+ void ProfileNew ( string NewName ) ;
63+
4664 /// <summary>
4765 /// Start over a new run.
4866 /// Increased the attempt counter, select first split and reset all values.
4967 /// </summary>
5068 void ProfileReset ( ) ;
5169
5270 /// <summary>
53- /// Amount of available splitsin the current run.
71+ /// Amount of available splits in the current run.
5472 /// </summary>
5573 int SplitCount { get ; }
5674
75+ /// <summary>
76+ /// Gets all split names of the currently selected profile.
77+ /// </summary>
78+ List < string > SplitsNames { get ; }
79+
5780 /// <summary>
5881 /// Index of currently active split.
5982 /// </summary>
6083 int ActiveSplit { get ; }
6184
6285 /// <summary>
63- /// Modifies the currently selected split by Amount.
86+ /// Creates a split at the end of the splits with the given new name.
87+ /// </summary>
88+ /// <param name="NewName">Name of the new split</param>
89+ void SplitAppendNew ( string NewName ) ;
90+
91+ /// <summary>
92+ /// Modifies the currently selected split by given <paramref name="Amount"/>.
6493 /// </summary>
6594 /// <param name="Amount">Amount of splits that will be moved forwards/backwards</param>
6695 void ProfileSplitGo ( int Amount ) ;
6796
97+ /// <summary>
98+ /// Inreases or decreases the hit counts of the currently selected split by <paramref name="Amount"/>.
99+ /// </summary>
100+ /// <param name="Amount">Positive values will increase and negative will decrease hit count respectively</param>
101+ /// <param name="IsWayHit">true = count towards way hits, false = count towards (boss) hits</param>
102+ public void HitSumUp ( int Amount , bool IsWayHit ) ;
103+
68104 /// <summary>
69105 /// Indicates if timer is currently running.
70106 /// </summary>
@@ -125,7 +161,7 @@ public interface IAutoSplitterCoreInterface
125161 Action < int /* ActiveGameIndex */ > SetActiveGameIndexMethod { get ; set ; }
126162
127163 /// <summary>
128- /// Method that gets called when the user changes the tPracticeMode .
164+ /// Method that gets called when the user changes the PracticeMode .
129165 /// A bool will be given with the new PracticeMode setting.
130166 /// The method should be filled once the registration method is called.
131167 /// </summary>
@@ -137,6 +173,13 @@ public interface IAutoSplitterCoreInterface
137173 /// </summary>
138174 Action SplitterResetMethod { get ; set ; }
139175
176+ /// <summary>
177+ /// Method that gets called when another profile got selected.
178+ /// A string will be given with the new selected profile name.
179+ /// The method should be filled once the registration method is called.
180+ /// </summary>
181+ Action < string /* ProfileName */ > ProfileSelectedMethod { get ; set ; }
182+
140183 #endregion
141184 }
142185
@@ -206,6 +249,8 @@ public bool GetCurrentInGameTime(out long totalTimeMs)
206249
207250 public void SplitterReset ( ) => SplitterResetMethod ? . Invoke ( ) ;
208251
252+ public void ProfileSelected ( string ProfileName ) => ProfileSelectedMethod ? . Invoke ( ProfileName ) ;
253+
209254 #region IAutoSplitterCoreInterface
210255
211256 public int ActiveGameIndex
@@ -220,14 +265,34 @@ public bool PracticeMode
220265 set => form1 . PracticeModeCheck . Checked = value ;
221266 }
222267
268+ public string ProfileName
269+ {
270+ get => profCtrl . SelectedProfileInfo . ProfileName ;
271+ set => profCtrl . SelectedProfileInfo . ProfileName = value ;
272+ }
273+
274+ public List < string > ProfileNames => [ .. profCtrl . GetProfileList ( ) ] ;
275+
276+ public void ProfileNew ( string NewName ) => profCtrl . ProfileNew ( NewName ) ;
277+
223278 public void ProfileReset ( ) => profCtrl . ProfileReset ( ) ;
224279
225280 public int SplitCount => profCtrl . SelectedProfileInfo . SplitCount ;
226281
282+ public List < string > SplitsNames => profCtrl . SelectedProfileInfo . SplitNames ;
283+
227284 public int ActiveSplit => profCtrl . SelectedProfileInfo . ActiveSplit ;
228285
286+ public void SplitAppendNew ( string NewName ) => profCtrl . SelectedProfileInfo . AddSplit ( NewName , 0 , 0 , 0 , 0 , 0 , 0 ) ;
287+
229288 public void ProfileSplitGo ( int Amount ) => profCtrl . ProfileSplitGo ( Amount ) ;
230289
290+ public void HitSumUp ( int Amount , bool IsWayHit )
291+ {
292+ if ( IsWayHit ) profCtrl . SelectedProfileInfo . WayHit ( Amount ) ;
293+ else profCtrl . SelectedProfileInfo . Hit ( Amount ) ;
294+ }
295+
231296 public bool TimerRunning => profCtrl . TimerRunning ;
232297
233298 public void StartStopTimer ( bool Start ) => form1 . StartStopTimer ( Start ) ;
@@ -248,6 +313,8 @@ public bool PracticeMode
248313
249314 public Action SplitterResetMethod { get ; set ; }
250315
316+ public Action < string /* ProfileName */ > ProfileSelectedMethod { get ; set ; }
317+
251318 #endregion
252319 }
253320}
0 commit comments