Added unitTypes json schema

This commit is contained in:
Yair Morgenstern 2023-09-24 12:24:41 +03:00
parent f13bb7990f
commit 46dd1cfc19
3 changed files with 28 additions and 3 deletions

View File

@ -50,9 +50,15 @@ Tada! Now Android Studio will recognize all Buildings.json files as belonging to
},
{
"fileMatch": [
"*/TileImprovements.json"
"*/Techs.json"
],
"url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/tileImprovements.json"
"url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/techs.json"
},
{
"fileMatch": [
"*/UnitTypes.json"
],
"url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/unitTypes.json"
}
]
```

View File

@ -8,7 +8,7 @@
"terrainsCanBeBuiltOn": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true,
"uniqueItems": true
},
"turnsToBuild": { "type": "integer" },
"techRequired": { "type": "string" },

View File

@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"movementType": {
"enum": ["Land", "Water", "Air"]
},
"uniques": { "$ref": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/uniques.json" },
"civilopediaText": { "$ref": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/civilopediaText.json" }
},
"required": [
"name", "movementType"
],
"additionalProperties": false
}
}