public void Start() { StartTime = DateTime.Now; CurrentTime = -Settings.TimeWindowMillis * 1000; AllNotesQueue = new Queue <Note>(AllNotes); OnScreenNotes.Clear(); SongJudgement = new Judgement(this); Piano.CurrentSong = this; }
public void Update(GameTime gameTime) { CurrentTime += (int)(gameTime.ElapsedGameTime.TotalMilliseconds * 1000); while (AllNotesQueue.Count > 0 && AllNotesQueue.Peek().TimeAs <MetricTimeSpan>(SongTempoMap).TotalMicroseconds < (CurrentTime + Settings.TimeWindowMillis * 1000)) { var note = AllNotesQueue.Dequeue(); OnScreenNotes.Enqueue(note); } while (OnScreenNotes.Count > 0 && OnScreenNotes.Peek().EndTimeAs <MetricTimeSpan>(SongTempoMap).TotalMicroseconds < CurrentTime) { var note = OnScreenNotes.Dequeue(); } SongJudgement.Update(); }