public static DeloreanModsCopy Load(string name) { if (!name.ToLower().EndsWith(".dmc12")) { name = name + ".dmc12"; } IFormatter formatter = new BinaryFormatter(); Stream stream = new FileStream($"{PresetsPath}/{name}", FileMode.Open, FileAccess.Read); DeloreanModsCopy deloreanModsCopy = (DeloreanModsCopy)formatter.Deserialize(stream); stream.Close(); return(deloreanModsCopy); }
public DeloreanCopy(DeloreanTimeMachine sourceCar, bool noLastDisplacementCopy = false) { Mods = new DeloreanModsCopy(sourceCar.Mods); Circuits = new TimeCircuitsCopy(sourceCar.Circuits, noLastDisplacementCopy); VehicleInfo = new VehicleInfo(sourceCar.Vehicle); }
public void Load(string name) => DeloreanModsCopy.Load(name).ApplyTo(TimeMachine);