public void Load() { if (File.Exists(ProfilePath + "/" + ProfileName + ".dat")) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(ProfilePath + "/" + ProfileName + ".dat", FileMode.Open); KingdomProfileData data = (KingdomProfileData)bf.Deserialize(file); file.Close(); ProfilePath = data.ProfilePath; ProfileID = data.ProfileID; ProfileName = data.ProfileName; ProfilePass = data.ProfilePass; NewAccount = data.NewAccount; Health = data.Health; MaxHealth = data.MaxHealth; Progress = data.Progress; Tools = data.Tools; CurrencyName = data.CurrencyName; CurrencyAmt = data.CurrencyAmt; BuildingName = data.BuildingName; BuildingUpgrades = data.BuildingUpgrades; KingdomNames = data.KingdomNames; KingdomTrades = data.KingdomTrades; MineName = data.MineName; MineAmmount = data.MineAmmount; NewPlayer = data.NewPlayer; } }
public void Save() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(ProfilePath + "/" + ProfileName + ".dat"); KingdomProfileData data = new KingdomProfileData(); data.ProfilePath = ProfilePath; data.ProfileID = ProfileID; data.ProfileName = ProfileName; data.ProfilePass = ProfilePass; data.NewAccount = NewAccount; data.Health = Health; data.MaxHealth = MaxHealth; data.Progress = Progress; data.Tools = Tools; data.CurrencyName = CurrencyName; data.CurrencyAmt = CurrencyAmt; data.BuildingName = BuildingName; data.BuildingUpgrades = BuildingUpgrades; data.KingdomNames = KingdomNames; data.KingdomTrades = KingdomTrades; data.MineName = MineName; data.MineAmmount = MineAmmount; data.NewPlayer = NewPlayer; bf.Serialize(file, data); file.Close(); }
public void Save() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(ProfilePath + "/" + "KingdomClickerProfiles" + ".dat"); KingdomProfileData data = new KingdomProfileData(); data.ProfilePath = ProfilePath; data.ProfileID = ProfileID; data.ProfileName = ProfileName; data.ProfilePass = ProfilePass; data.NewAccount = NewAccount; bf.Serialize(file, data); file.Close(); }
public void Load() { if (File.Exists(ProfilePath + "/" + "KingdomClickerProfiles" + ".dat")) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(ProfilePath + "/" + "KingdomClickerProfiles" + ".dat", FileMode.Open); KingdomProfileData data = (KingdomProfileData)bf.Deserialize(file); file.Close(); ProfilePath = data.ProfilePath; ProfileID = data.ProfileID; ProfileName = data.ProfileName; ProfilePass = data.ProfilePass; NewAccount = data.NewAccount; } }