From 8678e4eeda7616516bf21bb08b2a6001886349a4 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 22 Sep 2023 10:31:45 +0300 Subject: [PATCH] Added units.json and separate schemas for uniques and civilopediaText, for sharing --- docs/Modders/schemas/buildings.json | 13 ---- docs/Modders/schemas/civilopediaText.json | 19 ++++++ docs/Modders/schemas/uniques.json | 4 ++ docs/Modders/schemas/units.json | 74 +++++++++++++++++++++++ 4 files changed, 97 insertions(+), 13 deletions(-) create mode 100644 docs/Modders/schemas/civilopediaText.json create mode 100644 docs/Modders/schemas/uniques.json create mode 100644 docs/Modders/schemas/units.json diff --git a/docs/Modders/schemas/buildings.json b/docs/Modders/schemas/buildings.json index d08a70de6d..c772dc54ab 100644 --- a/docs/Modders/schemas/buildings.json +++ b/docs/Modders/schemas/buildings.json @@ -56,19 +56,6 @@ "additionalProperties": false }, "definitions": { - "stats": { - "type": "object", - "properties": { - "production": { "type": "number" }, - "food": { "type": "number" }, - "gold": { "type": "number" }, - "science": { "type": "number" }, - "culture": { "type": "number" }, - "happiness": { "type": "number" }, - "faith": { "type": "number" } - }, - "additionalProperties": false - }, "civilopediaText": { "type": "object", "properties": { diff --git a/docs/Modders/schemas/civilopediaText.json b/docs/Modders/schemas/civilopediaText.json new file mode 100644 index 0000000000..6e5d22d91b --- /dev/null +++ b/docs/Modders/schemas/civilopediaText.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "text": { "type": "string" }, + "link": { "type": "string" }, + "icon": { "type": "string" }, + "extraImage": { "type": "string" }, + "imageSize": { "type": "number" }, + "size": { "type": "number" }, + "header": { "type": "number" }, + "indent": { "type": "number" }, + "padding": { "type": "number" }, + "color": { "type": "string" }, + "separator": { "type": "boolean" }, + "starred": { "type": "boolean" }, + "centered": { "type": "boolean" }, + "iconCrossed": { "type": "boolean" } + } +} diff --git a/docs/Modders/schemas/uniques.json b/docs/Modders/schemas/uniques.json new file mode 100644 index 0000000000..8e975ce420 --- /dev/null +++ b/docs/Modders/schemas/uniques.json @@ -0,0 +1,4 @@ +{ + "type": "array", + "items": { "type": "string" } +} diff --git a/docs/Modders/schemas/units.json b/docs/Modders/schemas/units.json new file mode 100644 index 0000000000..5fe0913682 --- /dev/null +++ b/docs/Modders/schemas/units.json @@ -0,0 +1,74 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "unitType": { "type": "string" }, + + "movement": { "type": "number" }, + + "strength": { "type": "number" }, + "rangedStrength": { "type": "number" }, + "religiousStrength": { "type": "number" }, + "range": { "type": "number" }, + "interceptRange": { "type": "number" }, + + "cost": { "type": "number" }, + "hurryCostModifier": { "type": "number" }, + + "requiredResource": { "type": "string" }, + "requiredTech": { "type": "string" }, + "obsoleteTech": { "type": "string" }, + "upgradesTo": { "type": "string" }, + + "uniqueTo": { "type": "string" }, + "replaces": { "type": "string" }, + + "uniques": { "$ref": "#/definitions/uniques" }, + + "promotions": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true + }, + + "attackSound": { "type": "string" }, + "replacementTextForUniques": { "type": "string" }, + "civilopediaText": { + "type": "array", + "items": { "$ref": "#/definitions/civilopediaText"} + } + }, + "required": [ + "name", "unitType" + ], + "additionalProperties": false + }, + "definitions": { + "uniques": { + "type": "array", + "items": { "type": "string" } + }, + "civilopediaText": { + "type": "object", + "properties": { + "text": { "type": "string" }, + "link": { "type": "string" }, + "icon": { "type": "string" }, + "extraImage": { "type": "string" }, + "imageSize": { "type": "number" }, + "size": { "type": "number" }, + "header": { "type": "number" }, + "indent": { "type": "number" }, + "padding": { "type": "number" }, + "color": { "type": "string" }, + "separator": { "type": "boolean" }, + "starred": { "type": "boolean" }, + "centered": { "type": "boolean" }, + "iconCrossed": { "type": "boolean" } + } + } + } +}