Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. const example = {
  2. startMap: 'Something',
  3. monsters: [],
  4. monstersToOmit: [],
  5. mapsOrder: [1, 2],
  6. mapsData: [
  7. {
  8. id: 1,
  9. name: 'lol',
  10. gates: [
  11. {
  12. toId: 2,
  13. coords: {
  14. x: 49,
  15. y: 28
  16. }
  17. }
  18. ],
  19. waypoints: [
  20. [
  21. {x: 81, y: 50},
  22. {x: 53, y: 59},
  23. {x: 64, y: 15},
  24. {x: 87, y: 20}
  25. ],
  26. [
  27. {x: 93, y: 54},
  28. {x: 90, y: 10},
  29. {x: 67, y: 16},
  30. {x: 51, y: 54}
  31. ],
  32. [
  33. {x: 86, y: 57},
  34. {x: 77, y: 19},
  35. {x: 59, y: 20},
  36. {x: 54, y: 58}
  37. ]
  38. ]
  39. },
  40. {
  41. id: 2,
  42. name: 'nothin',
  43. gates: [
  44. {
  45. toId: 1,
  46. coords: {
  47. x: 95,
  48. y: 49
  49. }
  50. }
  51. ],
  52. waypoints: [
  53. {x: 40, y: 1},
  54. {x: 57, y: 8},
  55. {x: 79, y: 7},
  56. {x: 81, y: 31},
  57. {x: 61, y: 28},
  58. {x: 22, y: 16},
  59. {x: 11, y: 13},
  60. {x: 42, y: 49},
  61. {x: 49, y: 51},
  62. {x: 78, y: 50},
  63. {x: 42, y: 37},
  64. {x: 15, y: 37},
  65. {x: 7, y: 51}
  66. ]
  67. }
  68. ]
  69. };
  70.  
  71. 'use strict'
  72. const mongoose = require('mongoose');
  73. const Schema = mongoose.Schema;
  74.  
  75.  
  76. const mapSchema = new Schema({
  77. startMap: {
  78. type: String,
  79. required: true,
  80. unique: true
  81. },
  82. monsters: {
  83. type: Array,
  84. required: true
  85. },
  86. monstersToOmit: {
  87. type: Array,
  88. required: true
  89. },
  90. mapsOrder: {
  91. type: Array,
  92. required: true
  93. },
  94. mapsData: {
  95. ???
  96. }
  97. });
  98.  
  99. mapsData: [{
  100. id: Number,
  101. name: String,
  102. gates: [{
  103. toId: Number,
  104. coords: {
  105. x: Number,
  106. y: Number
  107. }
  108. }],
  109. waypoints: [[{x: Number, y: Number}]]
  110. }]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement