public void RhythmsZeroPadding() { var barCount = new List<int>(); var count = new List<int>(); foreach (var barNumber in Notes) { barCount.Add(barNumber.Bar); } barCount.Sort(); int barMax = barCount.Max(); for (int i = 0; i <= barMax; i++) { count.Add(i); } var differences = count.Except<int>(barCount); foreach (var item in differences) { var note = new Note(); note.Bar = item; note.Type = "10"; note.X = 0; note.Y = 0; note.Rhythm = "0"; note.ZeroPadding(); Notes.Insert(item, note); } Notes.Sort((a, b) => a.Bar - b.Bar); }
List<Note> parseNotes() { var notes = new List<Note>(); foreach (string data in fileData) { if (data[0] == Note.MapPrefix) { var note = new Note(); note.Bar = int.Parse(data.Substring(1, 3)); note.Type = data.Substring(4, 2); note.X = Convert.ToInt32(data.Substring(6, 2), 16); note.Y = Convert.ToInt32(data.Substring(8, 2), 16); note.Rhythm = data.Substring(data.IndexOf(":") + 1); note.ZeroPadding(); notes.Add(note); } } return notes; }