Exemplo n.º 1
0
 public void Reset()
 {
     StartPosition = null;
     EndPosition   = null;
     SelectedNoteList.Clear();
     SelectedLongNoteList.Clear();
 }
Exemplo n.º 2
0
 // REVIEW: この辺の生ノーツデータを手づかみで触る処理はここじゃなくてNoteBookでやったほうが安全じゃない…?
 public void ReverseNotes(NoteBook noteBook, LaneBook laneBook)
 {
     ReverseShortNotes(SelectedNoteList, laneBook, noteBook);
     SelectedLongNoteList.ForEach(x =>
     {
         ReverseShortNotes(x, laneBook, noteBook);
     });
 }
Exemplo n.º 3
0
        /// <summary>
        /// 選択矩形の左上の位置が引数のpositionとなるように移動します
        /// </summary>
        /// <param name="position"></param>
        /// <param name="laneBook"></param>
        // REVIEW: この辺の生ノーツデータを手づかみで触る処理はここじゃなくてNoteBookでやったほうが安全じゃない…?
        public void Relocate(Position position, LaneBook laneBook)
        {
            if (StartPosition == null || EndPosition == null || position == null)
            {
                return;
            }
            Position prevStartPosition = new Position(TopLeftPosition);
            Position areaSize          = new Position(BottomRightPosition.Lane - TopLeftPosition.Lane, TopLeftPosition.Tick - BottomRightPosition.Tick);
            int      newStartLane      = position.Lane;

            if (newStartLane < 0)
            {
                newStartLane = 0;
            }
            else if (newStartLane + areaSize.Lane > 15)
            {
                newStartLane = 15 - areaSize.Lane;
            }
            int newStartTick = position.Tick;

            if (newStartTick - areaSize.Tick < 0)
            {
                newStartTick = areaSize.Tick;
            }
            StartPosition = new Position(
                newStartLane,
                newStartTick);
            EndPosition = new Position(
                StartPosition.Lane + areaSize.Lane,
                StartPosition.Tick - areaSize.Tick);
            SelectedNoteList.ForEach(x =>
            {
                Position positionDelta = x.Position - prevStartPosition;
                x.RelocateOnlyAndUpdate(new Position(newStartLane + positionDelta.Lane, newStartTick + positionDelta.Tick), laneBook);
            });
            SelectedLongNoteList.ForEach(x =>
            {
                x.ForEach(y =>
                {
                    Position positionDelta = y.Position - prevStartPosition;
                    y.RelocateOnlyAndUpdate(new Position(newStartLane + positionDelta.Lane, newStartTick + positionDelta.Tick), laneBook);
                });
            });
        }
Exemplo n.º 4
0
        public void SetContainsNotes(NoteBook noteBook)
        {
            SelectedNoteList.Clear();
            SelectedLongNoteList.Clear();
            if (Status.IsShortNoteVisible)
            {
                SelectedNoteList = noteBook.ShortNotes.Where(x => Contains(x)).ToList();
            }
            if (Status.IsHoldVisible)
            {
                SelectedLongNoteList = SelectedLongNoteList.Union(noteBook.HoldNotes.Where(x => Contains(x))).ToList();
            }
            if (Status.IsSlideVisible)
            {
                SelectedLongNoteList = SelectedLongNoteList.Union(noteBook.SlideNotes.Where(x => Contains(x))).ToList();
            }
            var b = SelectedNoteList.Any() || SelectedLongNoteList.Any();

            Status.OnCopyChanged(b);
        }
Exemplo n.º 5
0
 /// <summary>
 /// 保持している矩形領域内のノーツのリストを空にします。
 /// </summary>
 public void ClearSelectedList()
 {
     SelectedNoteList.Clear();
     SelectedLongNoteList.Clear();
 }