public static void PushModdedData(GameV09 game) { foreach (var mod in data.segments) { Debug.Log($"Splicing data from mod {mod.modid} which {mod.identifiableData.Count} pieces of identifiable data"); foreach (var customData in mod.identifiableData) { switch (customData.dataID.Type) { case IdentifierType.ACTOR: game.actors.Add((VanillaActorData)customData.data); break; case IdentifierType.GADGET: game.world.placedGadgets[customData.dataID.stringID] = (VanillaGadgetData)customData.data; break; default: throw new NotImplementedException(); } } mod.playerData.Push(game.player); mod.pediaData.Push(game.pedia); foreach (var ammo in mod.customAmmo) { AmmoDataUtils.SpliceAmmoData(AmmoIdentifier.ResolveToData(ammo.Key, game), ammo.Value); } } ExtendedData.Pull(data); PersistentAmmoManager.Pull(data); }
public static void PushAllModdedData(ModdedSaveData data, Game game) { ExtendedData.Pull(data); PushAllSegmentData(data, game); PersistentAmmoManager.Pull(data); PushAllPartialData(data, game); }