public static result Save(Dictionary <int, Proto.ProtoScene.protoRow> items, string path)
 {
     try
     {
         Proto.ProtoScene prt       = new Proto.ProtoScene();
         byte[]           fileBytes = prt.protoSerialize(items);
         if (File.Exists(path))
         {
             File.Delete(path);
         }
         using (Stream file = File.OpenWrite(path))
         {
             file.Write(fileBytes, 0, fileBytes.Length);
         }
         return(null);
     }
     catch (Exception ex) { return(new result(null, ex)); }
 }
 private static result LoadScenes(string path)
 {
     try
     {
         if (File.Exists(path))
         {
             Proto.ProtoScene prt       = new Proto.ProtoScene();
             byte[]           fileBytes = File.ReadAllBytes(path);
             Dictionary <int, Proto.ProtoScene.protoRow> items = prt.protoDeserialize(fileBytes);
             if (items == null)
             {
                 return(new result(null, new Exception("Ошибка сериализации!")));
             }
             return(new result(items, null));
         }
         else
         {
             return(new result(null, new Exception($"Файл {path} не найден!")));
         }
     }
     catch (Exception ex) { return(new result(null, ex)); }
 }