Exemplo n.º 1
0
 public void InsertScoreForwardWithNote(NoteBook noteBook, ScoreBook database, Score baseScore, ScoreBook newScores)
 {
     if (database.Next(baseScore) == null)
     {
         SetScore(database, newScores);
     }
     else
     {
         InsertScoreBackwardWithNote(noteBook, database, database.Next(baseScore), newScores);
     }
 }
Exemplo n.º 2
0
 public void InsertScoreForwardWithNote(NoteBook noteBook, ScoreBook scoreBook, Score score, int beatNumer, int beatDenom, int barCount)
 {
     if (scoreBook.Next(score) == null)
     {
         SetScore(scoreBook, beatNumer, beatDenom, barCount);
     }
     else
     {
         InsertScoreBackwardWithNote(noteBook, scoreBook, scoreBook.Next(score), beatNumer, beatDenom, barCount);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// scoreを始めとしてcount個のScoreを削除
        /// </summary>
        /// <param name="model"></param>
        /// <param name="score"></param>
        /// <param name="count"></param>
        public void DeleteScore(ScoreBook scoreBook, Score score, int count)
        {
            Score itrScore;
            int   itrCount;

            //scoreからcount個Scoreを削除
            for (itrScore = score, itrCount = count; itrScore != null && itrCount > 0; itrScore = scoreBook.Next(itrScore), --itrCount)
            {
                //選択されたScoreが初めて含まれるレーンを特定
                ScoreLane laneBegin = Find(x => x.Contains(itrScore));
                int       linkCount = itrScore.LinkCount;
                System.Diagnostics.Debug.Assert(linkCount > 0, "linkCount is zero");
                for (int i = 0; i < linkCount; ++i)
                {
                    laneBegin.DeleteScore(itrScore);
                    if (!laneBegin.Any())
                    {
                        ScoreLane blankLane = laneBegin;
                        laneBegin = Next(laneBegin);
                        Remove(blankLane);
                    }
                    else
                    {
                        laneBegin = Next(laneBegin);
                    }
                }
#if DEBUG
                System.Diagnostics.Debug.WriteLine("LinkCount : " + linkCount.ToString());
#endif
            }
            //scoreBookから該当範囲のScoreを削除
            scoreBook.Delete(score.Index, count);
            //レーンを詰める
            FillLane();
            //詰み対策(雑)
            if (!this.Any())
            {
                SetScore(scoreBook, 4, 4, 1);
            }
        }