private static async Task ClickGossipOption(GossipEntry gossipEntry, int gossipPage)
        {
            // Log the gossip option we're about to take...
            QBCLog.DeveloperInfo(
                "Selecting Gossip Option({0}) on page {1}: \"{2}\"",
                gossipEntry.Index + 1,
                gossipPage,
                gossipEntry.Text);

            GossipFrame.Instance.SelectGossipOption(gossipEntry.Index);
            await CommonCoroutines.SleepForLagDuration();

            await CommonCoroutines.SleepForRandomUiInteractionTime();
        }
            private bool TryGetGossipEntry(int gossipOptionWanted, out GossipEntry gossipEntry)
            {
                try
                {
                    // NB: This clumsiness is because HB defines the default GossipEntry with an
                    // an Index of 0.  Since this is a valid gossip option index, this leaves us with
                    // no way to determine the difference between the 'default' value, and a valid
                    // value. So, we try to get the gossip entry using First() (vs. FirstOrDefault()),
                    // and if an exception gets thrown, we know the entry is not present.
                    if (GossipFrame.Instance.GossipOptionEntries == null)
                    {
                        throw new InvalidOperationException();
                    }

                    gossipEntry = GossipFrame.Instance.GossipOptionEntries
                                  .First(o => o.Index == gossipOptionWanted);
                }
                catch (InvalidOperationException)
                {
                    gossipEntry = new GossipEntry();
                    return(false);
                }
                return(true);
            }
Example #3
0
 public GossipOptionEntry(GossipEntry entry)
 {
     Text  = entry.Text;
     Index = entry.Index;
     Type  = entry.Type;
 }