コード例 #1
0
        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]);
                }
            }
        }
コード例 #2
0
 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);
 }
コード例 #3
0
        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();
                    }
                }
            }
        }
コード例 #4
0
 private static bool RequiresAction(HornNote hornNote)
 {
     return(hornNote.Key != HornNote.Keys.None);
 }
コード例 #5
0
 protected bool Equals(HornNote other)
 {
     return(Key == other.Key && Octave == other.Octave);
 }