static OfferEntry FindCorrespondingOffer(Item item)
        {
            var data = new OfferingData();

            if (data.lookup.TryGetValue(item.Name, out OfferEntry Offer))
            {
                return(Offer);
            }
            foreach (var tag in item.GetContextTagList())
            {
                if (data.lookup.TryGetValue(tag, out Offer))
                {
                    return(Offer);
                }
            }
            return(null);
        }
 private static void OnDayStarted(object sender, DayStartedEventArgs e)
 {
     Data = new OfferingData();
     PerformedOfferingToday = false;
 }
Пример #3
0
 internal OfferingData()
 {
     lookup = new Dictionary <string, OfferEntry>();
     lookup = ModEntry.Helper.Data.ReadJsonFile <Dictionary <string, OfferEntry> >("assets//OfferingData.json");
     Data   = this;
 }