예제 #1
0
        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);
        }
예제 #2
0
 public string GetImageSurfacePath() => System.IO.Path.Combine(System.IO.Path.Combine(GardenData.GetImagePath(), "plants"), Name.Replace(' ', '_') + ".png");