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(); } } } }
protected bool Equals(HornNote other) { return(Key == other.Key && Octave == other.Octave); }
private static bool RequiresAction(HornNote hornNote) { return(hornNote.Key != HornNote.Keys.None); }