示例#1
0
 public void Push(VanillaWorldData data)
 {
     foreach (var v in econSaturations)
     {
         if (ModdedIDRegistry.IsValidID(v.Key))
         {
             data.econSaturations[v.Key] = v.Value;
         }
     }
     data.pendingOfferRancherIds.AddRange(pendingOfferRancherIds.Where(ExchangeOfferRegistry.IsCustom));
     data.lastOfferRancherIds.AddRange(lastOfferRancherIds.Where(ExchangeOfferRegistry.IsCustom));
 }
示例#2
0
 public void Pull(VanillaWorldData data, SRMod mod)
 {
     foreach (var v in data.econSaturations)
     {
         if (ModdedIDRegistry.ModForID(v.Key) == mod)
         {
             econSaturations.Add(v.Key, v.Value);
         }
     }
     pendingOfferRancherIds.AddRange(data.pendingOfferRancherIds.Where((x) => ExchangeOfferRegistry.GetModForID(x) == mod));
     lastOfferRancherIds.AddRange(data.lastOfferRancherIds.Where((x) => ExchangeOfferRegistry.GetModForID(x) == mod));
 }
示例#3
0
        public static HashSet <SRMod> FindAllModsWithData(VanillaWorldData data)
        {
            var set = new HashSet <SRMod>();

            foreach (var v in data.econSaturations)
            {
                set.Add(ModdedIDRegistry.ModForID(v.Key));
            }

            foreach (var v in data.lastOfferRancherIds.Select(ExchangeOfferRegistry.GetModForID))
            {
                set.Add(v);
            }
            foreach (var v in data.pendingOfferRancherIds.Select(ExchangeOfferRegistry.GetModForID))
            {
                set.Add(v);
            }
            set.Remove(null);
            return(set);
        }