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