Example #1
0
        public override void PlayNote(Note note)
        {
            var bellNote = BellNote.From(note);

            if (RequiresAction(bellNote))
            {
                if (bellNote.Key == BellNote.Keys.None)
                {
                    PressNote(GuildWarsControls.EliteSkill);
                }
                else
                {
                    bellNote = OptimizeNote(bellNote);
                    PressNote(NoteMap[bellNote.Key]);
                }
            }
        }
Example #2
0
 private BellNote OptimizeNote(BellNote note)
 {
     if (note.Equals(new BellNote(BellNote.Keys.Note1, BellNote.Octaves.High)) && CurrentOctave == BellNote.Octaves.Middle)
     {
         note = new BellNote(BellNote.Keys.Note8, BellNote.Octaves.Middle);
     }
     else if (note.Equals(new BellNote(BellNote.Keys.Note8, BellNote.Octaves.Middle)) && CurrentOctave == BellNote.Octaves.High)
     {
         note = new BellNote(BellNote.Keys.Note1, BellNote.Octaves.High);
     }
     else if (note.Equals(new BellNote(BellNote.Keys.Note1, BellNote.Octaves.Middle)) && CurrentOctave == BellNote.Octaves.Low)
     {
         note = new BellNote(BellNote.Keys.Note8, BellNote.Octaves.Low);
     }
     else if (note.Equals(new BellNote(BellNote.Keys.Note8, BellNote.Octaves.Low)) && CurrentOctave == BellNote.Octaves.Middle)
     {
         note = new BellNote(BellNote.Keys.Note1, BellNote.Octaves.Middle);
     }
     return(note);
 }
Example #3
0
        public override void GoToOctave(Note note)
        {
            var bellNote = BellNote.From(note);

            if (RequiresAction(bellNote))
            {
                bellNote = OptimizeNote(bellNote);

                while (CurrentOctave != bellNote.Octave)
                {
                    if (CurrentOctave < bellNote.Octave)
                    {
                        IncreaseOctave();
                    }
                    else
                    {
                        DecreaseOctave();
                    }
                }
            }
        }
 protected bool Equals(BellNote other)
 {
     return(Key == other.Key && Octave == other.Octave);
 }
Example #5
0
 private static bool RequiresAction(BellNote bellNote)
 {
     return(bellNote.Key != BellNote.Keys.None);
 }