Esempio n. 1
0
 public void LoadSurface(string key, LoessSurface surf)
 {
     if (json.TryGetValue(key, out var jList))
     {
         foreach (var v in jList.ToObject <float[][]>())
         {
             surf.Add(v[0], v[1], v[2]);
         }
     }
 }
Esempio n. 2
0
        public void SaveSurface(string key, LoessSurface surf)
        {
            var arr = surf.buckets.Cast <LoessSurface.Entry>()
                      .Where(e => e.n > 0)
                      .Select(e => new float[] { e.pt.X, e.pt.Y, e.value })
                      .ToArray();

            json[key] = JToken.FromObject(arr);
            QueueSave();
        }