コード例 #1
0
ファイル: Flute.cs プロジェクト: Invisi/Blish-HUD
 private FluteNote OptimizeNote(FluteNote note)
 {
     if (note.Equals(new FluteNote(FluteNote.Keys.Note1, FluteNote.Octaves.High)) && _currentOctave == FluteNote.Octaves.Low)
     {
         note = new FluteNote(FluteNote.Keys.Note8, FluteNote.Octaves.Low);
     }
     else if (note.Equals(new FluteNote(FluteNote.Keys.Note8, FluteNote.Octaves.Low)) && _currentOctave == FluteNote.Octaves.High)
     {
         note = new FluteNote(FluteNote.Keys.Note1, FluteNote.Octaves.High);
     }
     return(note);
 }
コード例 #2
0
ファイル: Flute.cs プロジェクト: Invisi/Blish-HUD
        public override void PlayNote(Note note)
        {
            var fluteNote = FluteNote.From(note);

            if (RequiresAction(fluteNote))
            {
                if (fluteNote.Key == FluteNote.Keys.None)
                {
                    PressNote(GuildWarsControls.EliteSkill);
                }
                else
                {
                    fluteNote = OptimizeNote(fluteNote);
                    PressNote(NoteMap[fluteNote.Key]);
                }
            }
        }
コード例 #3
0
ファイル: Flute.cs プロジェクト: Invisi/Blish-HUD
        public override void GoToOctave(Note note)
        {
            var fluteNote = FluteNote.From(note);

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

                while (_currentOctave != fluteNote.Octave)
                {
                    if (_currentOctave < fluteNote.Octave)
                    {
                        IncreaseOctave();
                    }
                    else
                    {
                        DecreaseOctave();
                    }
                }
            }
        }
コード例 #4
0
 protected bool Equals(FluteNote other)
 {
     return(Key == other.Key && Octave == other.Octave);
 }
コード例 #5
0
ファイル: Flute.cs プロジェクト: Invisi/Blish-HUD
 private static bool RequiresAction(FluteNote fluteNote)
 {
     return(fluteNote.Key != FluteNote.Keys.None);
 }