public static bool Load(string filename) { GardenData obj; try { obj = JsonConvert.DeserializeObject <GardenData>(File.ReadAllText(filename)); } catch (System.Exception e) { ErrorMessage = e.Message; return(false); } LoadedData = obj; GardenData.unsaved = false; if (!LoadedData.Consistency()) { System.Console.WriteLine("Consistency check failed"); } return(true); }
public string GetImageSurfacePath() => System.IO.Path.Combine(System.IO.Path.Combine(GardenData.GetImagePath(), "plants"), Name.Replace(' ', '_') + ".png");