public override void PlayNote(Note note) { var hornNote = HornNote.From(note); if (RequiresAction(hornNote)) { if (hornNote.Key == HornNote.Keys.None) { PressNote(GuildWarsControls.EliteSkill); } else { hornNote = OptimizeNote(hornNote); PressNote(NoteMap[hornNote.Key]); } } }
private HornNote OptimizeNote(HornNote note) { if (note.Equals(new HornNote(HornNote.Keys.Note1, HornNote.Octaves.High)) && CurrentOctave == HornNote.Octaves.Middle) { note = new HornNote(HornNote.Keys.Note8, HornNote.Octaves.Middle); } else if (note.Equals(new HornNote(HornNote.Keys.Note8, HornNote.Octaves.Middle)) && CurrentOctave == HornNote.Octaves.High) { note = new HornNote(HornNote.Keys.Note1, HornNote.Octaves.High); } else if (note.Equals(new HornNote(HornNote.Keys.Note1, HornNote.Octaves.Middle)) && CurrentOctave == HornNote.Octaves.Low) { note = new HornNote(HornNote.Keys.Note8, HornNote.Octaves.Low); } else if (note.Equals(new HornNote(HornNote.Keys.Note8, HornNote.Octaves.Low)) && CurrentOctave == HornNote.Octaves.Middle) { note = new HornNote(HornNote.Keys.Note1, HornNote.Octaves.Middle); } return(note); }
public override void GoToOctave(Note note) { var hornNote = HornNote.From(note); if (RequiresAction(hornNote)) { hornNote = OptimizeNote(hornNote); while (CurrentOctave != hornNote.Octave) { if (CurrentOctave < hornNote.Octave) { IncreaseOctave(); } else { DecreaseOctave(); } } } }
private static bool RequiresAction(HornNote hornNote) { return(hornNote.Key != HornNote.Keys.None); }
protected bool Equals(HornNote other) { return(Key == other.Key && Octave == other.Octave); }