Ejemplo n.º 1
0
        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]);
                }
            }
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        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();
                    }
                }
            }
        }
Ejemplo n.º 4
0
 private static bool RequiresAction(LuteNote luteNote)
 {
     return(luteNote.Key != LuteNote.Keys.None);
 }
Ejemplo n.º 5
0
 protected bool Equals(LuteNote other)
 {
     return(Key == other.Key && Octave == other.Octave);
 }