/// <summary> /// 分数を指定できるショートノーツ用コンストラクタです /// </summary> /// <param name="_musicscore"></param> /// <param name="_position"></param> /// <param name="_noteSize"></param> /// <param name="_noteStyle"></param> /// <param name="_airDirection"></param> /// <param name="_longNoteNumber"></param> /// <param name="_beat"></param> public ShortNote(MusicScore _musicscore, Point _position, int _noteSize, string _noteStyle, string _airDirection, int _longNoteNumber, int _beat) { musicscore = _musicscore; position = _position; startPosition = _position; endPosition = _position; noteSize = _noteSize;//1-16 noteStyle = _noteStyle; airDirection = _airDirection; longNoteNumber = _longNoteNumber; // prevNote = null; nextNote = null; //destPoints = new Point[3]; noteImage = setNoteImage(); pos.Beat = _beat; setRelativePosition(); }
/// <summary> /// SlideLine専用コンストラクタです /// </summary> /// <param name="_musicscore"></param> /// <param name="_position"></param> /// <param name="_startPosition"></param> /// <param name="_endPosition"></param> /// <param name="_startSize"></param> /// <param name="_endSize"></param> /// <param name="_longNoteNumber"></param> public ShortNote(MusicScore _musicscore, Point _position, Point _startPosition, Point _endPosition, int _startSize, int _endSize, int _longNoteNumber) { musicscore = _musicscore; position = _position; startPosition = _startPosition; endPosition = _endPosition; startSize = _startSize; //1-16 endSize = _endSize; //1-16 noteStyle = "SlideLine"; airDirection = "Center"; longNoteNumber = _longNoteNumber; //this.visible = visible == 0 ? false : true; // prevNote = null; nextNote = null; //destPoints = new Point[3]; noteImage = setNoteImage(); pos.Beat = MusicScore.SelectedBeat; setRelativePosition(); }
/* * public int setLNN() * { * * * return longNotesNumber; * } * //*/ //*//test public void setLongNote(ShortNote note, MusicScore score) { Graphics g = Graphics.FromImage(score.StoreImage); //g.DrawImage(Properties.Resources.MusicScore, new Point(0, 0)); switch (note.NoteStyle) { case "Hold": break; case "Slide": case "SlideEnd": case "SlideTap": case "SlideRelay": ShortNote nextNote = null, prevNote = null; for (MusicScore iScore = score; iScore.NextScore != null && nextNote == null; iScore = iScore.NextScore) //次の中継点ノーツを探してnextNoteに { if (iScore == score) //初回 { foreach (ShortNote iNote in score.shortNotes.Where( x => x.NotePosition.Y < note.NotePosition.Y).OrderByDescending(x => x.NotePosition.Y)) { if (iNote.LongNoteNumber == note.LongNoteNumber && iNote.NoteStyle != "SlideCurve") { nextNote = iNote; break; } } } else { foreach (ShortNote iNote in iScore.shortNotes.OrderByDescending(x => x.NotePosition.Y)) { if (iNote.LongNoteNumber == note.LongNoteNumber && iNote.NoteStyle != "SlideCurve") { nextNote = iNote; break; } } } } for (MusicScore iScore = score; iScore.PrevScore != null && prevNote == null; iScore = iScore.PrevScore) //前の中継点ノーツを探してprevNoteに { if (iScore == score) //初回 { foreach (ShortNote iNote in score.shortNotes.Where( x => x.NotePosition.Y > note.NotePosition.Y && x.LongNoteNumber != -1).OrderBy(x => x.NotePosition.Y)) { if (iNote.LongNoteNumber == note.LongNoteNumber && iNote.NoteStyle != "SlideCurve") { prevNote = iNote; break; } } } else { foreach (ShortNote iNote in iScore.shortNotes.OrderBy(x => x.NotePosition.Y)) { if (iNote.LongNoteNumber == note.LongNoteNumber && iNote.NoteStyle != "SlideCurve") { prevNote = iNote; break; } } } } if (nextNote == null) { return; } int nMeasure = nextNote.LocalPosition.Measure; int cMeasure = note.LocalPosition.Measure; int measureDiff = (nMeasure % 2 == 0 ? nMeasure - 1 : nMeasure) / 2 - (cMeasure % 2 == 0 ? cMeasure - 1 : cMeasure) / 2; Point nPnt, cPnt; int nSize, cSize; if (measureDiff == 0) //2ノーツは同じ譜面レーン上 { //draw nPnt = nextNote.NotePosition; nSize = nextNote.NoteSize; cPnt = note.NotePosition; cSize = note.NoteSize; Point[] ps = { new Point(nPnt.X + 2, nPnt.Y), new Point(cPnt.X + 2, cPnt.Y), new Point(cPnt.X + cSize * 10 - 2, cPnt.Y), new Point(nPnt.X + nSize * 10 - 2, nPnt.Y) }; g.FillPolygon(Brushes.Aqua, ps); } else //2ノーツは異なるレーン上(境界を何度かまたぐ) { //draw(begin) for (int i = 0; i < measureDiff - 1; i++) { } //draw(end) } break; case "AirBegin": case "AirAction": break; default: break; } g.Dispose(); }