private static void PushSegmentAmmoData(Game game, ModDataSegment mod) { foreach (var ammo in mod.customAmmo) { if (!ammo.Key.IsValid()) { continue; } AmmoDataUtils.SpliceAmmoData(AmmoIdentifier.ResolveToData(ammo.Key, game), ammo.Value); } }
private static void PushSegmentFullData(Game game, ModDataSegment mod) { Debug.Log($"Splicing data from mod {mod.modid} which has {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; case IdentifierType.LANDPLOT: game.ranch.plots.Add((VanillaPlotData)customData.data); break; case IdentifierType.GORDO: game.world.gordos[customData.dataID.stringID] = (GordoV01)customData.data; break; case IdentifierType.TREASUREPOD: game.world.treasurePods[customData.dataID.stringID] = (TreasurePodV01)customData.data; break; case IdentifierType.EXCHANGEOFFER: var offertype = (ExchangeDirector.OfferType)(int) customData.dataID.longID; if (Enum.IsDefined(typeof(ExchangeDirector.OfferType), offertype)) { game.world.offers[offertype] = (ExchangeOfferV04)customData.data; } break; default: throw new NotImplementedException(); } } }
private static void PushSegmentTertiaryData(Game game, ModDataSegment mod) { mod.playerData.Push(game.player); mod.pediaData.Push(game.pedia); mod.worldData.Push(game.world); }