spellbook.json 2.9 KB

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