1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

RMG schema now actually works

This commit is contained in:
Ivan Savenko
2023-09-18 00:30:42 +03:00
parent 43020c8108
commit 52cb4505e1

View File

@@ -8,16 +8,35 @@
"zone" : { "zone" : {
"type" : "object", "type" : "object",
"required" : ["type", "monsters", "size"], "required" : ["type", "monsters", "size"],
"additionalProperties" : false,
"properties" : { "properties" : {
"type" : {"$ref" : "#/definitions/type"}, "type" : {
"size" : {"$ref" : "#/definitions/size"}, "type" : "string",
"playerTowns" : {"$ref" : "#/definitions/playerTowns"}, "enum" : ["playerStart", "cpuStart", "treasure", "junction"]
"neuralTowns" : {"$ref" : "#/definitions/neuralTowns"}, },
"townsAreSameType" : {"$ref" : "#/definitions/townsAreSameType"}, "size" : { "type" : "number", "minimum" : 1 },
"terrainTypes": {"$ref" : "#/definitions/terrains"}, "owner" : {},
"bannedTerrains": {"$ref" : "#/definitions/terrains"}, "playerTowns" : {"$ref" : "#/definitions/towns"},
"monsters" : {"$ref" : "#/definitions/monsters"}, "neutralTowns" : {"$ref" : "#/definitions/towns"},
"bannedMonsters" : {"$ref" : "#/definitions/monsters"}, "matchTerrainToTown" : { "type" : "boolean"},
"minesLikeZone" : { "type" : "number" },
"terrainTypeLikeZone" : { "type" : "number" },
"treasureLikeZone" : { "type" : "number" },
"terrainTypes": {"$ref" : "#/definitions/stringArray"},
"bannedTerrains": {"$ref" : "#/definitions/stringArray"},
"townsAreSameType" : { "type" : "boolean"},
"allowedMonsters" : {"$ref" : "#/definitions/stringArray"},
"bannedMonsters" : {"$ref" : "#/definitions/stringArray"},
"allowedTowns" : {"$ref" : "#/definitions/stringArray"},
"bannedTowns" : {"$ref" : "#/definitions/stringArray"},
"monsters" : {
"type" : "string",
"enum" : ["weak", "normal", "strong", "none"]
},
"mines" : {"$ref" : "#/definitions/mines"}, "mines" : {"$ref" : "#/definitions/mines"},
"treasure" : { "treasure" : {
"type" : "array", "type" : "array",
@@ -33,15 +52,33 @@
} }
} }
}, },
"type" : {
"type" : "string", "towns" : {
"type" : "object",
"additionalProperties" : false, "additionalProperties" : false,
"enum" : ["playerStart", "cpuStart", "treasure", "junction"] "properties" : {
"towns" : { "type" : "number" },
"castles" : { "type" : "number" },
"townDensity" : { "type" : "number" },
"castleDensity" : { "type" : "number" }
}
}, },
"size" : { "stringArray" : {
"type" : "number", "type" : "array",
"minimum" : 1, "items" : { "type" : "string" }
"additionalProperties" : false },
"mines" : {
"type" : "object",
"additionalProperties" : false,
"properties" : {
"gold" : { "type" : "number"},
"wood" : { "type" : "number"},
"ore" : { "type" : "number"},
"mercury" : { "type" : "number"},
"sulfur" : { "type" : "number"},
"crystal" : { "type" : "number"},
"gems" : { "type" : "number"}
}
}, },
"connection" : "connection" :
{ {
@@ -74,10 +111,24 @@
"type" : "string" "type" : "string"
} }
}, },
"additionalProperties" : false,
"properties" : "properties" :
{ {
"required" : ["zones", "connections"], "required" : ["zones", "connections", "minSize", "maxSize", "players"],
"additionalProperties" : false,
"players" : {
"type": "string"
},
"cpu" : {
"type": "string"
},
"minSize" : {
"type": "string"
},
"maxSize" : {
"type": "string"
},
"description" : { "description" : {
"type": "string" "type": "string"
}, },