@bct-app/game-model 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/index.d.ts +633 -0
- package/dist/schemas/character-basic-kind.schema.json +13 -0
- package/dist/schemas/character-kind.schema.json +11 -0
- package/dist/schemas/effect.schema.json +703 -0
- package/dist/schemas/game.schema.json +113 -0
- package/dist/schemas/index.json +9 -0
- package/dist/schemas/input.schema.json +523 -0
- package/dist/schemas/message.schema.json +358 -0
- package/dist/schemas/view.schema.json +382 -0
- package/package.json +49 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"oneOf": [
|
|
4
|
+
{
|
|
5
|
+
"$ref": "#/definitions/CharacterView"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"$ref": "#/definitions/CharacterKindView"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "#/definitions/AlignmentView"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"$ref": "#/definitions/NumberView"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"$ref": "#/definitions/PlayerView"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"$ref": "#/definitions/BooleanView"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"$ref": "#/definitions/TextView"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"$ref": "#/definitions/StatusView"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"$ref": "#/definitions/ReminderView"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"$ref": "#/definitions/PlayerReminderView"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"definitions": {
|
|
36
|
+
"CharacterView": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": {
|
|
39
|
+
"source": {
|
|
40
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
41
|
+
},
|
|
42
|
+
"type": {
|
|
43
|
+
"$ref": "#/definitions/__schema2"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": [
|
|
47
|
+
"source",
|
|
48
|
+
"type"
|
|
49
|
+
],
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"id": "CharacterView",
|
|
52
|
+
"title": "角色选择视图",
|
|
53
|
+
"description": "提供一个角色的选择视图,通常用于需要指定角色的技能选项"
|
|
54
|
+
},
|
|
55
|
+
"BaseSourceModel": {
|
|
56
|
+
"oneOf": [
|
|
57
|
+
{
|
|
58
|
+
"$ref": "#/definitions/__schema0"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"$ref": "#/definitions/__schema1"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"id": "BaseSourceModel",
|
|
65
|
+
"title": "基础来源模型",
|
|
66
|
+
"description": "基础来源模型,包含来自技能载荷和常量两种来源"
|
|
67
|
+
},
|
|
68
|
+
"__schema0": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"properties": {
|
|
71
|
+
"from": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"const": "PAYLOAD"
|
|
74
|
+
},
|
|
75
|
+
"value": {
|
|
76
|
+
"anyOf": [
|
|
77
|
+
{
|
|
78
|
+
"default": 0,
|
|
79
|
+
"type": "number",
|
|
80
|
+
"minimum": 0
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"default": [
|
|
84
|
+
0
|
|
85
|
+
],
|
|
86
|
+
"type": "array",
|
|
87
|
+
"items": {
|
|
88
|
+
"type": "number",
|
|
89
|
+
"minimum": 0
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": [
|
|
96
|
+
"from",
|
|
97
|
+
"value"
|
|
98
|
+
],
|
|
99
|
+
"additionalProperties": false
|
|
100
|
+
},
|
|
101
|
+
"__schema1": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"properties": {
|
|
104
|
+
"from": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"const": "CONSTANT"
|
|
107
|
+
},
|
|
108
|
+
"value": {}
|
|
109
|
+
},
|
|
110
|
+
"required": [
|
|
111
|
+
"from",
|
|
112
|
+
"value"
|
|
113
|
+
],
|
|
114
|
+
"additionalProperties": false
|
|
115
|
+
},
|
|
116
|
+
"__schema2": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"const": "CHARACTER"
|
|
119
|
+
},
|
|
120
|
+
"CharacterKindView": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"properties": {
|
|
123
|
+
"source": {
|
|
124
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
125
|
+
},
|
|
126
|
+
"type": {
|
|
127
|
+
"$ref": "#/definitions/__schema3"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": [
|
|
131
|
+
"source",
|
|
132
|
+
"type"
|
|
133
|
+
],
|
|
134
|
+
"additionalProperties": false,
|
|
135
|
+
"id": "CharacterKindView",
|
|
136
|
+
"title": "角色类型视图",
|
|
137
|
+
"description": "提供一个角色类型的选择视图,通常用于需要指定角色类型的技能选项"
|
|
138
|
+
},
|
|
139
|
+
"__schema3": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"const": "CHARACTER_KIND"
|
|
142
|
+
},
|
|
143
|
+
"AlignmentView": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"properties": {
|
|
146
|
+
"source": {
|
|
147
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
148
|
+
},
|
|
149
|
+
"type": {
|
|
150
|
+
"$ref": "#/definitions/__schema4"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"required": [
|
|
154
|
+
"source",
|
|
155
|
+
"type"
|
|
156
|
+
],
|
|
157
|
+
"additionalProperties": false,
|
|
158
|
+
"id": "AlignmentView",
|
|
159
|
+
"title": "阵营选择视图",
|
|
160
|
+
"description": "提供一个阵营的选择视图,通常用于需要指定阵营的技能选项"
|
|
161
|
+
},
|
|
162
|
+
"__schema4": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"const": "ALIGNMENT"
|
|
165
|
+
},
|
|
166
|
+
"NumberView": {
|
|
167
|
+
"type": "object",
|
|
168
|
+
"properties": {
|
|
169
|
+
"source": {
|
|
170
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
171
|
+
},
|
|
172
|
+
"type": {
|
|
173
|
+
"$ref": "#/definitions/__schema5"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"required": [
|
|
177
|
+
"source",
|
|
178
|
+
"type"
|
|
179
|
+
],
|
|
180
|
+
"additionalProperties": false,
|
|
181
|
+
"id": "NumberView",
|
|
182
|
+
"title": "数字选择视图",
|
|
183
|
+
"description": "提供一个数字的选择视图,通常用于需要指定数字的技能选项"
|
|
184
|
+
},
|
|
185
|
+
"__schema5": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"const": "NUMBER"
|
|
188
|
+
},
|
|
189
|
+
"PlayerView": {
|
|
190
|
+
"type": "object",
|
|
191
|
+
"properties": {
|
|
192
|
+
"source": {
|
|
193
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
194
|
+
},
|
|
195
|
+
"type": {
|
|
196
|
+
"$ref": "#/definitions/__schema6"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"required": [
|
|
200
|
+
"source",
|
|
201
|
+
"type"
|
|
202
|
+
],
|
|
203
|
+
"additionalProperties": false,
|
|
204
|
+
"id": "PlayerView",
|
|
205
|
+
"title": "玩家选择视图",
|
|
206
|
+
"description": "提供一个玩家的选择视图,通常用于需要指定玩家的技能选项"
|
|
207
|
+
},
|
|
208
|
+
"__schema6": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"const": "PLAYER"
|
|
211
|
+
},
|
|
212
|
+
"BooleanView": {
|
|
213
|
+
"type": "object",
|
|
214
|
+
"properties": {
|
|
215
|
+
"source": {
|
|
216
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
217
|
+
},
|
|
218
|
+
"type": {
|
|
219
|
+
"$ref": "#/definitions/__schema7"
|
|
220
|
+
},
|
|
221
|
+
"texts": {
|
|
222
|
+
"$ref": "#/definitions/__schema8"
|
|
223
|
+
},
|
|
224
|
+
"style": {
|
|
225
|
+
"$ref": "#/definitions/__schema9"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"required": [
|
|
229
|
+
"source",
|
|
230
|
+
"type",
|
|
231
|
+
"texts",
|
|
232
|
+
"style"
|
|
233
|
+
],
|
|
234
|
+
"additionalProperties": false,
|
|
235
|
+
"id": "BooleanView",
|
|
236
|
+
"title": "布尔选择视图",
|
|
237
|
+
"description": "提供一个布尔选择视图,通常用于需要选择是或否的技能选项"
|
|
238
|
+
},
|
|
239
|
+
"__schema7": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"const": "BOOLEAN"
|
|
242
|
+
},
|
|
243
|
+
"__schema8": {
|
|
244
|
+
"default": [
|
|
245
|
+
"否",
|
|
246
|
+
"是"
|
|
247
|
+
],
|
|
248
|
+
"type": "array",
|
|
249
|
+
"items": [
|
|
250
|
+
{
|
|
251
|
+
"default": "否",
|
|
252
|
+
"type": "string"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"default": "是",
|
|
256
|
+
"type": "string"
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
},
|
|
260
|
+
"__schema9": {
|
|
261
|
+
"default": [
|
|
262
|
+
"ICON"
|
|
263
|
+
],
|
|
264
|
+
"type": "array",
|
|
265
|
+
"items": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"enum": [
|
|
268
|
+
"ICON",
|
|
269
|
+
"TEXT"
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"TextView": {
|
|
274
|
+
"type": "object",
|
|
275
|
+
"properties": {
|
|
276
|
+
"source": {
|
|
277
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
278
|
+
},
|
|
279
|
+
"type": {
|
|
280
|
+
"$ref": "#/definitions/__schema10"
|
|
281
|
+
},
|
|
282
|
+
"color": {
|
|
283
|
+
"$ref": "#/definitions/__schema11"
|
|
284
|
+
},
|
|
285
|
+
"fontSize": {
|
|
286
|
+
"$ref": "#/definitions/__schema12"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"required": [
|
|
290
|
+
"source",
|
|
291
|
+
"type",
|
|
292
|
+
"color",
|
|
293
|
+
"fontSize"
|
|
294
|
+
],
|
|
295
|
+
"additionalProperties": false,
|
|
296
|
+
"id": "TextView",
|
|
297
|
+
"title": "文本视图",
|
|
298
|
+
"description": "提供一个文本的视图,通常用于需要显示文本的技能选项"
|
|
299
|
+
},
|
|
300
|
+
"__schema10": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"const": "TEXT"
|
|
303
|
+
},
|
|
304
|
+
"__schema11": {
|
|
305
|
+
"default": "#000000",
|
|
306
|
+
"type": "string"
|
|
307
|
+
},
|
|
308
|
+
"__schema12": {
|
|
309
|
+
"default": 14,
|
|
310
|
+
"type": "number"
|
|
311
|
+
},
|
|
312
|
+
"StatusView": {
|
|
313
|
+
"type": "object",
|
|
314
|
+
"properties": {
|
|
315
|
+
"source": {
|
|
316
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
317
|
+
},
|
|
318
|
+
"type": {
|
|
319
|
+
"$ref": "#/definitions/__schema13"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"required": [
|
|
323
|
+
"source",
|
|
324
|
+
"type"
|
|
325
|
+
],
|
|
326
|
+
"additionalProperties": false,
|
|
327
|
+
"id": "StatusView",
|
|
328
|
+
"title": "状态视图",
|
|
329
|
+
"description": "提供一个状态的选择视图,通常用于需要指定状态的技能选项"
|
|
330
|
+
},
|
|
331
|
+
"__schema13": {
|
|
332
|
+
"type": "string",
|
|
333
|
+
"const": "STATUS"
|
|
334
|
+
},
|
|
335
|
+
"ReminderView": {
|
|
336
|
+
"type": "object",
|
|
337
|
+
"properties": {
|
|
338
|
+
"source": {
|
|
339
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
340
|
+
},
|
|
341
|
+
"type": {
|
|
342
|
+
"$ref": "#/definitions/__schema14"
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"required": [
|
|
346
|
+
"source",
|
|
347
|
+
"type"
|
|
348
|
+
],
|
|
349
|
+
"additionalProperties": false,
|
|
350
|
+
"id": "ReminderView",
|
|
351
|
+
"title": "提醒视图",
|
|
352
|
+
"description": "提供一个提醒的视图,通常用于需要显示提醒的技能选项"
|
|
353
|
+
},
|
|
354
|
+
"__schema14": {
|
|
355
|
+
"type": "string",
|
|
356
|
+
"const": "REMINDER"
|
|
357
|
+
},
|
|
358
|
+
"PlayerReminderView": {
|
|
359
|
+
"type": "object",
|
|
360
|
+
"properties": {
|
|
361
|
+
"source": {
|
|
362
|
+
"$ref": "#/definitions/BaseSourceModel"
|
|
363
|
+
},
|
|
364
|
+
"type": {
|
|
365
|
+
"$ref": "#/definitions/__schema15"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"required": [
|
|
369
|
+
"source",
|
|
370
|
+
"type"
|
|
371
|
+
],
|
|
372
|
+
"additionalProperties": false,
|
|
373
|
+
"id": "PlayerReminderView",
|
|
374
|
+
"title": "玩家提醒视图",
|
|
375
|
+
"description": "提供一个玩家提醒的视图,通常用于需要显示玩家提醒的技能选项"
|
|
376
|
+
},
|
|
377
|
+
"__schema15": {
|
|
378
|
+
"type": "string",
|
|
379
|
+
"const": "PLAYER_REMINDER"
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bct-app/game-model",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Game model package generated from TypeScript declaration emit",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"game-model",
|
|
7
|
+
"schema",
|
|
8
|
+
"zod",
|
|
9
|
+
"bct"
|
|
10
|
+
],
|
|
11
|
+
"author": "BCT-YH",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/BCT-YH/bct-server.git",
|
|
15
|
+
"directory": "packages/game-model"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"types": "dist/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./schemas": "./dist/schemas/index.json",
|
|
28
|
+
"./schemas/*": "./dist/schemas/*.schema.json",
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"clean": "rm -rf dist",
|
|
33
|
+
"build": "pnpm run clean && tsx scripts/build-types.ts && tsx scripts/build-schemas.ts",
|
|
34
|
+
"dev": "tsx watch scripts/build-types.ts",
|
|
35
|
+
"prepack": "pnpm run build",
|
|
36
|
+
"prepublishOnly": "pnpm run build",
|
|
37
|
+
"pack:check": "pnpm run build && npm pack --dry-run --ignore-scripts"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^25.1.0",
|
|
41
|
+
"ts-morph": "^27.0.2",
|
|
42
|
+
"tsx": "^4.21.0",
|
|
43
|
+
"zod": "4.3.6"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"sideEffects": false
|
|
49
|
+
}
|