11package main ;
22
3+ import lombok .extern .slf4j .Slf4j ;
34import osu .HitObject ;
45import osu .Sample ;
56import osu .Timing ;
89import javax .swing .*;
910import java .io .File ;
1011import java .util .ArrayList ;
11- import java .util .Collections ;
1212import java .util .List ;
13+ import java .util .Set ;
1314
15+ @ Slf4j
1416public class MagicCopyMania implements Runnable {
1517
1618 // Variables
@@ -85,14 +87,17 @@ public void run() {
8587 }
8688
8789 private String copyHS () {
88- Collections .sort (List_Samples , Sample .StartTimeComparator );
90+ List_Samples .sort (Sample .StartTimeComparator );
8991 StringBuilder output = new StringBuilder ();
90- ArrayList <HitObject > outputHOs = new ArrayList <HitObject >();
91- ArrayList <Long > list_time = OsuUtils .getDistinctStartTime (List_SourceHS , List_TargetHS );
92+ ArrayList <HitObject > outputHOs = new ArrayList <>();
93+ Set <Long > list_time = OsuUtils .getDistinctStartTime (List_SourceHS , List_TargetHS );
94+ log .debug ("full target HitObjects {}" , List_TargetHS );
9295 for (Long t : list_time ) {
9396
9497 ArrayList <HitObject > sourceChord = OsuUtils .getChordByTime (List_SourceHS , t );
98+ log .debug ("source chord: {}" , sourceChord );
9599 ArrayList <HitObject > targetChord = OsuUtils .getChordByTime (List_TargetHS , t );
100+ log .debug ("target chord: {}" , targetChord );
96101 int sourceSize = sourceChord .size ();
97102 int targetSize = targetChord .size ();
98103 if (sourceSize == targetSize ) {
@@ -106,7 +111,7 @@ private String copyHS() {
106111 }
107112 } else if (sourceSize > targetSize ) {
108113 // CASE 2
109- System . out . println ("sourceSize> targetSize at " + t );
114+ log . debug ("sourceSize > targetSize at {}" , t );
110115 if (targetSize == 0 ) {
111116 if (isKeysound ) {
112117 // keysound = true then copy to SB, else do nothing
@@ -119,10 +124,11 @@ private String copyHS() {
119124
120125 } else {
121126 int defaultHitSoundSize = OsuUtils .getDefaultHSChordSizeForTime (sourceChord , t );
127+ log .debug ("default HS size at {} is {}" , t , defaultHitSoundSize );
122128 switch (defaultHitSoundSize ) {
123129 case 0 :
124130 case 1 :
125- System . out . println ("source WFC size 0|1 at " + t );
131+ log . debug ("source WFC size 0|1 at {}" , t );
126132 for (int i = 0 ; i < targetSize ; i ++) {
127133 HitObject source_ho = sourceChord .get (i );
128134 HitObject target_ho = targetChord .get (i );
@@ -136,13 +142,12 @@ private String copyHS() {
136142 break ;
137143
138144 case 2 : // Combine both default hitsounds into 1 HitObject
139- System . out . println ("source WFC size 2 at " + t );
145+ log . debug ("source WFC size 2 at {}" , t );
140146 outputHOs .addAll (combineDefaultHS (sourceChord , targetChord , 2 ));
141147 break ;
142148
143149 case 3 :
144- System .out .println ("source WFC size 3 at " + t );
145- // System.out.println("target size " + targetSize);
150+ log .debug ("source WFC size 3 at {}" , t );
146151 if (targetSize >= 2 ) {
147152 if (sourceSize > defaultHitSoundSize ) {
148153 outputHOs .addAll (combineDefaultHS (sourceChord , targetChord , 3 ));
0 commit comments