Guest User

Untitled

a guest
Aug 17th, 2019
68
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Joints_
  2. {
  3. public Dictionary<string, int> joints_;
  4. public Joints_()
  5. {
  6. joints_ = new Dictionary<string, int>();
  7. }
  8. public Joints_(bool inizializza)
  9. {
  10. joints_ = new Dictionary<string, int>();
  11. for (int i=0; i<3; i++)
  12. {
  13. if (i == 0)
  14. {
  15. joints_["x"] = 678;
  16. }
  17. if (i == 1)
  18. {
  19. joints_["y"] = 2646;
  20. }
  21. if (i == 2)
  22. {
  23. joints_["z"] = 1234;
  24. }
  25. }
  26. }
  27. public void SaveWithJson(string fileName, ref Joints_ c)
  28. {
  29. File.WriteAllText(fileName, JsonConvert.SerializeObject(c, Formatting.Indented));
  30. }
  31. }
  32.  
  33. public class Persona_
  34. {
  35. public Dictionary<string, Joints_> persona_;
  36. public Persona_()
  37. {
  38. persona_ = new Dictionary<string, Joints_>();
  39. }
  40. public Persona_(bool inizializza)
  41. {
  42. persona_ = new Dictionary<string, Joints_>();
  43. for (int i = 1; i < 18; i++)
  44. {
  45. persona_["joint_" + i] = new Joints_(true);
  46. }
  47. }
  48. public void SaveWithJson(string fileName, ref Persona_ c)
  49. {
  50. File.WriteAllText(fileName, JsonConvert.SerializeObject(c, Formatting.Indented));
  51. }
  52. }
  53.  
  54. {
  55. "persona_": {
  56. "joint_1": {
  57. "joints_": {
  58. "x": 678,
  59. "y": 2646,
  60. "z": 1234
  61. }
  62. },
  63. etc etc....
  64.  
  65. {
  66. "persona_": {
  67. "joint_1": {
  68. "x": 678,
  69. "y": 2646,
  70. "z": 1234
  71. },
  72. etc etc....
RAW Paste Data