//public class SteelGuitar : GuitarBaseOptional, IGuitar<SteelGuitar> //{ // public string Name { get; set; } // public string GetType(ClassicalGuitar t) // { // return "The classical guitar is: " + t.Name; // } //} static void Main(string[] args) { ElectricGuitar eGuitar = new ElectricGuitar(); eGuitar.Name = "Model 5"; Console.WriteLine(eGuitar.GetType(eGuitar)); eGuitar.Builder = "Charvel"; Console.WriteLine("The builder is :" + eGuitar.Builder); Console.WriteLine("It was built on :" + eGuitar.GetBuildDate()); eGuitar.Cost = 800; Console.WriteLine("It sold for :" + eGuitar.GetSoldFor().ToString()); Console.WriteLine(); ClassicalGuitar cGuitar = new ClassicalGuitar(); cGuitar.Name = "C132S"; Console.WriteLine(cGuitar.GetType(cGuitar)); cGuitar.Builder = "Takamine"; Console.WriteLine("The builder is :" + cGuitar.Builder); Console.WriteLine("It was built on :" + cGuitar.GetBuildDate()); cGuitar.Cost = 350; Console.WriteLine("It sold for :" + cGuitar.GetSoldFor().ToString()); Console.ReadLine(); }
static void Main(string[] args) { ElectricGuitar eGuitar = new ElectricGuitar(); eGuitar.Name = "Charvel Model 5"; Console.WriteLine(eGuitar.GetBodyStyle(eGuitar)); ClassicalGuitar cGuitar = new ClassicalGuitar(); cGuitar.Name = "Takamine C132S"; Console.WriteLine(cGuitar.GetBodyStyle(cGuitar)); Console.ReadLine(); }
public MusicalNote_Eighth(GuitarStringType stringType, int noteValue, string id) { NoteID = "Eighth_" + id; NoteValue = noteValue; StringOfNote = ClassicalGuitar.EnumToObj(stringType); }
public MusicalNote_Quarter(GuitarStringType stringType, int noteValue, string id) { StringOfNote = ClassicalGuitar.EnumToObj(stringType); NoteID = "Quarter_" + id; NoteValue = noteValue; }
public MusicalNote_PunctedQuarter(GuitarStringType guitarString, int value, string id) { NoteValue = value; NoteID = "QuarterPuncted_" + id; StringOfNote = ClassicalGuitar.EnumToObj(guitarString); }
public MusicalNote_Half(GuitarStringType stringType, int noteValue, string id) { NoteValue = noteValue; StringOfNote = ClassicalGuitar.EnumToObj(stringType); NoteID = "Half_" + id; }
private static Song GetSongModel() { var song = new Song(); song.SongTitle = SongTitle; song.BPM = BpmValue; song.SongDuration = MusicalStorage.SongDurationInMS(); song.Notation = new List <INote>(); int beatCounter = -1; //2 strokes in the beginning, but we want to start with value 1 double strokeCounter = 0; foreach (var musicalNote in MusicalStorage.Melodie) { if (musicalNote is MusicalNote_Stroke) { beatCounter++; if (strokeCounter >= 4) { strokeCounter -= 4; } } else if (musicalNote is MusicalNote_Chord) { var chord = musicalNote as MusicalNote_Chord; var notationChord = new Chord(); notationChord.ID = chord.NoteID; notationChord.Duration = chord.GetMusicalDuration(); notationChord.BeatNumber = beatCounter; notationChord.StrokeNumber = strokeCounter; notationChord.Name = chord.ChordName; song.Notation.Add(new INote(notationChord)); strokeCounter += notationChord.Duration; } else { var notationNote = new Note(); notationNote.ID = musicalNote.NoteID; notationNote.Name = MusicalCalculator.GetNameFromPosition(ClassicalGuitar.ObjToEnum(musicalNote.StringOfNote), musicalNote.NoteValue); notationNote.Duration = musicalNote.GetMusicalDuration(); notationNote.BeatNumber = beatCounter; notationNote.StrokeNumber = strokeCounter; song.Notation.Add(new INote(notationNote)); strokeCounter += notationNote.Duration; } } return(song); }