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)); }
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)); }
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); }