Skip to content

Commit

Permalink
Reformat schema file
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxuanchiadm committed Feb 4, 2024
1 parent c4bf0d0 commit 5d2e8d1
Show file tree
Hide file tree
Showing 6 changed files with 1,376 additions and 1,299 deletions.
95 changes: 49 additions & 46 deletions ecnpc/container.schema.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://easecation.github.io/ECConfigSchema/ecnpc/container.schema.json",
"type": "object",
"properties": {
"reference": {
"type": "string"
},
"dialogue": {
"type": "object"
},
"hook": {
"type": "object"
},
"skin": {
"type": "array",
"items": {
"type": "object",
"properties": {
"skinId": {
"type": "string"
},
"skinData": {
"type": "string",
"format": "uri"
},
"skinPack": {
"type": "string",
"format": "uri"
},
"geometryName": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://easecation.github.io/ECConfigSchema/ecnpc/container.schema.json",
"title": "ECNPCContainer schema",
"type": "object",
"properties": {
"reference": {
"type": "string"
},
"geometryData": {
"type": "string",
"format": "uri"
}
},
"required": ["skinId"],
"additionalProperties": false
}
"dialogue": {
"type": "object"
},
"hook": {
"type": "object"
},
"skin": {
"type": "array",
"items": {
"type": "object",
"properties": {
"skinId": {
"type": "string"
},
"skinData": {
"type": "string",
"format": "uri"
},
"skinPack": {
"type": "string",
"format": "uri"
},
"geometryName": {
"type": "string"
},
"geometryData": {
"type": "string",
"format": "uri"
}
},
"required": [
"skinId"
],
"additionalProperties": false
}
},
"npc": {
"type": "array",
"items": {
"$ref": "prefab.schema.json"
}
}
},
"npc": {
"type": "array",
"items": {
"$ref": "prefab.schema.json"
}
}
},
"additionalProperties": true
"additionalProperties": true
}
143 changes: 78 additions & 65 deletions ecnpc/dialogue.handler.schema.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,88 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://easecation.github.io/ECConfigSchema/ecnpc/dialogue.handler.schema.json",
"type": "object",
"description": "对话的handler配置",
"properties": {
"type": {
"type": "string",
"description": "handler类型",
"enum": ["dialogue", "action", "random"]
}
},
"required": ["type"],
"oneOf": [
{
"$ref": "dialogue.schema.json"
},
{
"type": "object",
"description": "PlayerAction回调",
"properties": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://easecation.github.io/ECConfigSchema/ecnpc/dialogue.handler.schema.json",
"title": "ECNPC dialogue handler schema",
"type": "object",
"description": "对话的handler配置",
"properties": {
"type": {
"const": "action",
"description": "PlayerAction回调"
},
"callback": {
"oneOf": [
{
"type": "object",
"$ref": "../playeraction/playeraction.schema.json"
},
{
"type": "array",
"items": {
"$ref": "../playeraction/playeraction.schema.json"
}
}
]
"type": "string",
"description": "handler类型",
"enum": [
"dialogue",
"action",
"random"
]
}
},
"required": [
"type",
"callback"
]
},
{
"type": "object",
"properties": {
"type": {
"const": "random",
"description": "随机进行处理"
"required": [
"type"
],
"oneOf": [
{
"$ref": "dialogue.schema.json"
},
{
"type": "object",
"description": "PlayerAction回调",
"properties": {
"type": {
"const": "action",
"description": "PlayerAction回调"
},
"callback": {
"oneOf": [
{
"type": "object",
"$ref": "../playeraction/playeraction.schema.json"
},
{
"type": "array",
"items": {
"$ref": "../playeraction/playeraction.schema.json"
}
}
]
}
},
"required": [
"type",
"callback"
]
},
"handler": {
"type": "array",
"description": "随机处理器配置",
"items": {
{
"type": "object",
"properties": {
"weight": {
"type": "number",
"description": "随机权重"
},
"handler": {
"$ref": "#"
}
"type": {
"const": "random",
"description": "随机进行处理"
},
"handler": {
"type": "array",
"description": "随机处理器配置",
"items": {
"type": "object",
"properties": {
"weight": {
"type": "number",
"description": "随机权重"
},
"handler": {
"$ref": "#"
}
},
"required": [
"weight",
"handler"
]
}
}
},
"required": ["weight", "handler"]
}
"required": [
"type",
"handler"
],
"description": "随机进行处理"
}
},
"required": ["type", "handler"],
"description": "随机进行处理"
}
]
]
}
Loading

0 comments on commit 5d2e8d1

Please sign in to comment.