spellbook.json 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {
  2. "$schema": "http://json-schema.org/draft-06/schema#",
  3. "definitions": {
  4. "names": {
  5. "items": {"type": "string"},
  6. "type": "array"
  7. },
  8. "Inspired": {
  9. "patternProperties": {
  10. "^[0-9]$": {
  11. "properties": {
  12. "spellsPerDayRemaining": false,
  13. "spellsKnown": false
  14. }
  15. }
  16. }
  17. },
  18. "Spontaneous": {
  19. "patternProperties": {
  20. "^[0-9]$": {
  21. "properties": {
  22. "spellsPrepared": false,
  23. "spellsPreparedPreviously": false
  24. }
  25. }
  26. }
  27. },
  28. "Researched": {
  29. "patternProperties": {
  30. "^[0-9]$": {
  31. "properties": {
  32. "spellsPerDayRemaining": false
  33. }
  34. }
  35. }
  36. },
  37. "Retrieved": {
  38. "patternProperties": {
  39. "^[0-9]$": {
  40. "properties": {
  41. "spellsKnown": false
  42. }
  43. }
  44. }
  45. }
  46. },
  47. "properties": {
  48. "@class": {"type": "string"},
  49. "classRef": {"type": "string"},
  50. "spellInfo": {
  51. "dependencies":{
  52. "2":["1"],
  53. "3":["2"],
  54. "4":["3"],
  55. "5":["4"],
  56. "6":["5"],
  57. "7":["6"],
  58. "8":["7"],
  59. "9":["8"]
  60. },
  61. "propertyNames": {
  62. "enum": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
  63. },
  64. "additionalProperties": {
  65. "spellsPerDay": {"type": "integer"},
  66. "spellsPerDayRemaining": {"type": "integer"},
  67. "spellsKnown": {"$ref": "#/definitions/names"},
  68. "spellsPrepared": {"$ref": "#/definitions/names"},
  69. "spellsPreparedPreviously": {"$ref": "#/definitions/names"}
  70. },
  71. "type": "object"
  72. }
  73. },
  74. "oneOf": [
  75. {
  76. "properties": {
  77. "@class": {"const": "org.leumasjaffe.charsheet.model.magic.impl.Inspired"},
  78. "spellInfo": {"$ref": "#/definitions/Inspired"}
  79. },
  80. "required": ["classRef"]
  81. },
  82. {
  83. "properties": {
  84. "@class": {"const": "org.leumasjaffe.charsheet.model.magic.impl.Spontaneous"},
  85. "spellInfo": {"$ref": "#/definitions/Spontaneous"}
  86. }
  87. },
  88. {
  89. "properties": {
  90. "@class": {"const": "org.leumasjaffe.charsheet.model.magic.impl.Researched"},
  91. "spellInfo": {"$ref": "#/definitions/Researched"}
  92. }
  93. },
  94. {
  95. "properties": {
  96. "@class": {"const": "org.leumasjaffe.charsheet.model.magic.impl.Retrieved"},
  97. "spellInfo": {"$ref": "#/definitions/Retrieved"}
  98. },
  99. "required": ["classRef"]
  100. }
  101. ],
  102. "required": [
  103. "@class",
  104. "spellInfo"
  105. ],
  106. "type": "object",
  107. "additionalProperties": false
  108. }