Skip to content

Commit 2cfe601

Browse files
committed
Tech schema: Break out techs to a definition
This allows the extension techs to refer to a definition instead of the property they are part of, which works better with the "Typify" rust crate.
1 parent a95e6ca commit 2cfe601

1 file changed

Lines changed: 50 additions & 45 deletions

File tree

schema/m3-tech.schema.json

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,55 @@
33
"$id": "https://raw.githubusercontent.com/vg-json-data/sm-json-data/master/schema/m3-tech.schema.json",
44
"type": "object",
55
"title": "Super Metroid Tech Schema",
6+
"definitions": {
7+
"tech": {
8+
"type": "object",
9+
"title": "Tech",
10+
"description": "A tech that represents an in-game technique and the requirements for performing it",
11+
"required": ["name", "techRequires", "otherRequires"],
12+
"additionalProperties": false,
13+
"properties": {
14+
"id": {
15+
"type": "integer",
16+
"title": "Tech ID",
17+
"description": "Identifier for this tech, unique across all tech."
18+
},
19+
"name": {
20+
"type": "string",
21+
"title": "Tech Name",
22+
"description": "The name of this tech, to be referenced in logical requirements",
23+
"pattern": "^(.*)$"
24+
},
25+
"techRequires": {
26+
"$ref": "m3-requirements.schema.json#/definitions/logicalRequirements",
27+
"title": "Tech Requirements",
28+
"description": "Dependent tech required for this tech."
29+
},
30+
"otherRequires": {
31+
"$ref": "m3-requirements.schema.json#/definitions/logicalRequirements",
32+
"title": "Other Requirements",
33+
"description": "Other requirements to perform this tech, such as items or ammo."
34+
},
35+
"note": {
36+
"$ref": "m3-note.schema.json#/definitions/note"
37+
},
38+
"detailNote": {
39+
"$ref": "m3-note.schema.json#/definitions/detailNote"
40+
},
41+
"devNote": {
42+
"$ref": "m3-note.schema.json#/definitions/devNote"
43+
},
44+
"extensionTechs": {
45+
"type": "array",
46+
"title": "Extension techs",
47+
"description": "An array of extension techs. An extension tech is a more complex version of its parent tech. Its requirements stand alone and explicitly require the parent tech, but it's positioned under the parent to provide hints for cleaning up a tech UI.",
48+
"items": {
49+
"$ref": "#/definitions/tech"
50+
}
51+
}
52+
}
53+
}
54+
},
655
"properties": {
756
"$schema": {
857
"type": "string",
@@ -37,51 +86,7 @@
3786
"title": "Super Metroid Techs",
3887
"description": "An array of techs, each representing an in-game technique and the requirements for performing it. Any such technique could feasibly be turned off for randomizer logic.",
3988
"items": {
40-
"type": "object",
41-
"title": "Tech",
42-
"description": "A tech that represents an in-game technique and the requirements for performing it",
43-
"required": ["name", "techRequires", "otherRequires"],
44-
"additionalProperties": false,
45-
"properties": {
46-
"id": {
47-
"type": "integer",
48-
"title": "Tech ID",
49-
"description": "Identifier for this tech, unique across all tech."
50-
},
51-
"name": {
52-
"type": "string",
53-
"title": "Tech Name",
54-
"description": "The name of this tech, to be referenced in logical requirements",
55-
"pattern": "^(.*)$"
56-
},
57-
"techRequires": {
58-
"$ref": "m3-requirements.schema.json#/definitions/logicalRequirements",
59-
"title": "Tech Requirements",
60-
"description": "Dependent tech required for this tech."
61-
},
62-
"otherRequires": {
63-
"$ref": "m3-requirements.schema.json#/definitions/logicalRequirements",
64-
"title": "Other Requirements",
65-
"description": "Other requirements to perform this tech, such as items or ammo."
66-
},
67-
"note": {
68-
"$ref": "m3-note.schema.json#/definitions/note"
69-
},
70-
"detailNote": {
71-
"$ref": "m3-note.schema.json#/definitions/detailNote"
72-
},
73-
"devNote": {
74-
"$ref": "m3-note.schema.json#/definitions/devNote"
75-
},
76-
"extensionTechs": {
77-
"type": "array",
78-
"title": "Extension techs",
79-
"description": "An array of extension techs. An extension tech is a more complex version of its parent tech. Its requirements stand alone and explicitly require the parent tech, but it's positioned under the parent to provide hints for cleaning up a tech UI.",
80-
"items": {
81-
"$ref": "#/properties/techCategories/items/properties/techs/items"
82-
}
83-
}
84-
}
89+
"$ref": "#/definitions/tech"
8590
}
8691
}
8792
}

0 commit comments

Comments
 (0)