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