示例#1
0
        public static HashSet <SRMod> FindAllModsWithData(PlayerV14 player)
        {
            var mods = new HashSet <SRMod>();

            player.upgrades.ForEach((x) => mods.Add(ModdedIDRegistry.ModForID(x)));
            player.availUpgrades.ForEach((x) => mods.Add(ModdedIDRegistry.ModForID(x)));
            foreach (var x in player.upgradeLocks)
            {
                mods.Add(ModdedIDRegistry.ModForID(x.Key));
            }

            foreach (var x in player.progress)
            {
                mods.Add(ModdedIDRegistry.ModForID(x.Key));
            }
            foreach (var x in player.delayedProgress)
            {
                mods.Add(ModdedIDRegistry.ModForID(x.Key));
            }

            player.blueprints.ForEach((x) => mods.Add(ModdedIDRegistry.ModForID(x)));
            player.availBlueprints.ForEach((x) => mods.Add(ModdedIDRegistry.ModForID(x)));
            foreach (var x in player.blueprintLocks)
            {
                mods.Add(ModdedIDRegistry.ModForID(x.Key));
            }

            foreach (var x in player.gadgets)
            {
                mods.Add(ModdedIDRegistry.ModForID(x.Key));
            }

            foreach (var x in player.craftMatCounts)
            {
                mods.Add(ModdedIDRegistry.ModForID(x.Key));
            }

            player.mail.ForEach((x) => mods.Add(MailRegistry.GetModForMail(x.messageKey)));

            player.unlockedZoneMaps.ForEach((x) => mods.Add(ModdedIDRegistry.ModForID(x)));

            mods.Remove(null);
            return(mods);
        }
示例#2
0
        public void Push(PlayerV14 player)
        {
            player.upgrades.AddRange(upgrades.Where((x) => ModdedIDRegistry.IsValidID(x)));
            player.availUpgrades.AddRange(availUpgrades.Where((x) => ModdedIDRegistry.IsValidID(x)));
            AddRange(player.upgradeLocks, upgradeLocks.Where((x) => ModdedIDRegistry.IsValidID(x.Key)));

            AddRange(player.progress, progress.Where((x) => ModdedIDRegistry.IsValidID(x.Key)));
            AddRange(player.delayedProgress, delayedProgress.Where((x) => ModdedIDRegistry.IsValidID(x.Key)));

            player.blueprints.AddRange(blueprints.Where((x) => ModdedIDRegistry.IsValidID(x)));
            player.availBlueprints.AddRange(availBlueprints.Where((x) => ModdedIDRegistry.IsValidID(x)));
            AddRange(player.blueprintLocks, blueprintLocks.Where((x) => ModdedIDRegistry.IsValidID(x.Key)));

            AddRange(player.gadgets, gadgets.Where((x) => ModdedIDRegistry.IsValidID(x.Key)));

            AddRange(player.craftMatCounts, craftMatCounts.Where((x) => ModdedIDRegistry.IsValidID(x.Key)));
            player.unlockedZoneMaps.AddRange(unlockedZoneMaps.Where((x) => ModdedIDRegistry.IsValidID(unlockedZoneMaps)));
            player.mail.AddRange(mail.Where((x) => MailRegistry.GetModForMail(x.messageKey) != null));
        }
示例#3
0
        public void Pull(PlayerV14 player, SRMod ourMod)
        {
            upgrades.AddRange(player.upgrades.Where((x) => ModdedIDRegistry.ModForID(x) == ourMod));
            availUpgrades.AddRange(player.availUpgrades.Where((x) => ModdedIDRegistry.ModForID(x) == ourMod));
            AddRange(upgradeLocks, player.upgradeLocks.Where((x) => ModdedIDRegistry.ModForID(x.Key) == ourMod));

            AddRange(progress, player.progress.Where((x) => ModdedIDRegistry.ModForID(x.Key) == ourMod));
            AddRange(delayedProgress, player.delayedProgress.Where((x) => ModdedIDRegistry.ModForID(x.Key) == ourMod));

            blueprints.AddRange(player.blueprints.Where((x) => ModdedIDRegistry.ModForID(x) == ourMod));
            availBlueprints.AddRange(player.availBlueprints.Where((x) => ModdedIDRegistry.ModForID(x) == ourMod));
            AddRange(blueprintLocks, player.blueprintLocks.Where((x) => ModdedIDRegistry.ModForID(x.Key) == ourMod));

            AddRange(gadgets, player.gadgets.Where((x) => ModdedIDRegistry.ModForID(x.Key) == ourMod));

            AddRange(craftMatCounts, player.craftMatCounts.Where((x) => ModdedIDRegistry.ModForID(x.Key) == ourMod));

            unlockedZoneMaps.AddRange(player.unlockedZoneMaps.Where((x) => ModdedIDRegistry.ModForID(x) == ourMod));

            mail.AddRange(player.mail.Where((x) => MailRegistry.GetModForMail(x.messageKey) == ourMod));
        }