예제 #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]);
                }
            }
        }
예제 #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);
 }
예제 #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();
                    }
                }
            }
        }
예제 #4
0
 private static bool RequiresAction(LuteNote luteNote)
 {
     return(luteNote.Key != LuteNote.Keys.None);
 }
예제 #5
0
 protected bool Equals(LuteNote other)
 {
     return(Key == other.Key && Octave == other.Octave);
 }