示例#1
0
        private Dictionary <Vector2, int> DeserializeSavedTerrain()
        {
            var terrainLocation     = Path.Combine(TileDecayJsonFilePath);
            var jsonTerrainFeatures = new JsonTerrainFeatures().HoeDirtTile;

            jsonTerrainFeatures = JsonConvert.DeserializeObject <Dictionary <Vector2, int> >(Encoding.UTF8.GetString(File.ReadAllBytes(terrainLocation)));

            if (jsonTerrainFeatures == null)
            {
                var newJTFeat = new JsonTerrainFeatures();
                return(newJTFeat.HoeDirtTile);
            }
            return(jsonTerrainFeatures);
        }
示例#2
0
 public NoSoilDecay()
 {
     JsonTerrainFeatures  = new JsonTerrainFeatures();
     IsFirstRun           = false;
     HasDeserializedToday = false;
 }