コード例 #1
0
ファイル: SelectionArea.cs プロジェクト: oxy0723/M4ple-Editor
 // REVIEW: この辺の生ノーツデータを手づかみで触る処理はここじゃなくてNoteBookでやったほうが安全じゃない…?
 private void ReverseShortNotes(List <Note> noteList, LaneBook laneBook, NoteBook noteBook)
 {
     noteList.ForEach(x =>
     {
         int reverseLane      = BottomRightPosition.Lane - (x.Position.Lane - TopLeftPosition.Lane + x.Size) + 1;
         Position newPosition = new Position(reverseLane, x.Position.Tick);
         x.RelocateOnlyAndUpdate(newPosition, laneBook);
         if (x is AirableNote airable && airable.IsAirAttached)
         {
             Air newAir = null;
             if (airable.Air is AirUpL)
             {
                 newAir = new AirUpR(x);
             }
             else if (airable.Air is AirUpR)
             {
                 newAir = new AirUpL(x);
             }
             else if (airable.Air is AirDownL)
             {
                 newAir = new AirDownR(x);
             }
             else if (airable.Air is AirDownR)
             {
                 newAir = new AirDownL(x);
             }
             if (newAir != null)
             {
                 noteBook.DetachAirFromAirableNote(airable, out _);
                 noteBook.AttachAirToAirableNote(airable, newAir);
             }
         }
     });
 }