public override string Serialize() { //Implementation.Log("Serializing CookingPotWaterSaveData"); GetFromCookingPot(); CookingPotWaterSaveProxy saveProxy = new CookingPotWaterSaveProxy { cookingState = this.cookingState, litersSnowBeingMelted = this.litersSnowBeingMelted, litersWaterBeingBoiled = this.litersWaterBeingBoiled, minutesUntilCooked = this.minutesUntilCooked, minutesUntilRuined = this.minutesUntilRuined }; return(JSON.Dump(saveProxy)); }
public override void Deserialize(string data) { //Implementation.Log("Deserializing CookingPotWaterSaveData"); if (!string.IsNullOrEmpty(data)) { CookingPotWaterSaveProxy saveProxy = JSON.Load(data).Make <CookingPotWaterSaveProxy>(); this.cookingState = saveProxy.cookingState; this.litersSnowBeingMelted = saveProxy.litersSnowBeingMelted; this.litersWaterBeingBoiled = saveProxy.litersWaterBeingBoiled; this.minutesUntilCooked = saveProxy.minutesUntilCooked; this.minutesUntilRuined = saveProxy.minutesUntilRuined; ApplyToCookingPot(); } }