I want to have a class where I can set
and get
for each note. So I parse an XML file and with each <note>
attribute in the file, I set and get the Note class. This was an alternative method to the Dictionary<int,string>
that I had last time.
So why did I change it? Because for the double notes, (when the times were the same), the int within the dictionary would be a duplicate key and throw an error. So now, I've made a list with my Note
class.
Here's the note class:
class Note
{
public enum Notes
{
A, S, D, J, K, L,
};
public Notes CurrentNote { get; set; }
public string Time { get; set; }
public Note(Notes Note, string Time) {
this.CurrentNote = Note;
this.Time = Time;
}
}
And then in my NoteManager.cs
, I'll add to the list and set the values through that. But I'm not totally sure if this will work? I've never worked with getting and setting of classes. I tried adding the Notes to the list, but the way that I get the values doesn't seem to work. It gives a weird output.
System.Linq.Enumberable+D_3a`1[Hit_Machine.Managers.Note]
Here's the NoteManager.cs Class:
class NoteManager : Game1
{
public static List<Note> Notes = new List<Note>();
public static void addNotes() {
Notes.Add(new Note(Note.Notes.A, "22.22"));
Notes.Add(new Note(Note.Notes.A, "33.33"));
Notes.Add(new Note(Note.Notes.A, "55.55"));
}
public static void getNotes(Game1 Parent)
{
Game1.myGameText = Notes.Take(5).ToString();
}
}
So what actually would be the proper way of using this method?