spellbook.json 2.7 KB

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