@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.
@@ -0,0 +1,113 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "owner": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ },
9
+ "scriptId": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "numberOfPlayer": {
14
+ "default": 8,
15
+ "type": "integer",
16
+ "exclusiveMinimum": 0,
17
+ "maximum": 9007199254740991
18
+ },
19
+ "characterKinds": {
20
+ "default": [],
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "properties": {
25
+ "kind": {
26
+ "type": "string"
27
+ },
28
+ "count": {
29
+ "default": 0,
30
+ "type": "integer",
31
+ "minimum": 0,
32
+ "maximum": 9007199254740991
33
+ }
34
+ },
35
+ "required": [
36
+ "kind",
37
+ "count"
38
+ ],
39
+ "additionalProperties": false
40
+ }
41
+ },
42
+ "characters": {
43
+ "default": [],
44
+ "type": "array",
45
+ "items": {
46
+ "type": "string"
47
+ }
48
+ },
49
+ "seats": {
50
+ "default": [],
51
+ "type": "array",
52
+ "items": {
53
+ "anyOf": [
54
+ {
55
+ "type": "object",
56
+ "properties": {
57
+ "userId": {
58
+ "type": "string"
59
+ },
60
+ "ready": {
61
+ "default": false,
62
+ "type": "boolean"
63
+ }
64
+ },
65
+ "required": [
66
+ "userId",
67
+ "ready"
68
+ ],
69
+ "additionalProperties": false
70
+ },
71
+ {
72
+ "type": "null"
73
+ }
74
+ ]
75
+ }
76
+ },
77
+ "result": {
78
+ "type": "string",
79
+ "enum": [
80
+ "goodWin",
81
+ "evilWin"
82
+ ]
83
+ },
84
+ "createdAt": {
85
+ "type": "string",
86
+ "format": "date-time",
87
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
88
+ },
89
+ "startedAt": {
90
+ "type": "string",
91
+ "format": "date-time",
92
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
93
+ },
94
+ "endedAt": {
95
+ "type": "string",
96
+ "format": "date-time",
97
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
98
+ }
99
+ },
100
+ "required": [
101
+ "owner",
102
+ "scriptId",
103
+ "numberOfPlayer",
104
+ "characterKinds",
105
+ "characters",
106
+ "seats",
107
+ "result",
108
+ "createdAt",
109
+ "startedAt",
110
+ "endedAt"
111
+ ],
112
+ "additionalProperties": false
113
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "game": "./game.schema.json",
3
+ "effect": "./effect.schema.json",
4
+ "input": "./input.schema.json",
5
+ "view": "./view.schema.json",
6
+ "character-basic-kind": "./character-basic-kind.schema.json",
7
+ "message": "./message.schema.json",
8
+ "character-kind": "./character-kind.schema.json"
9
+ }
@@ -0,0 +1,523 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "oneOf": [
4
+ {
5
+ "$ref": "#/definitions/PlayerInput"
6
+ },
7
+ {
8
+ "$ref": "#/definitions/CharacterInput"
9
+ },
10
+ {
11
+ "$ref": "#/definitions/AlignmentInput"
12
+ },
13
+ {
14
+ "$ref": "#/definitions/CharacterKindInput"
15
+ },
16
+ {
17
+ "$ref": "#/definitions/BooleanInput"
18
+ },
19
+ {
20
+ "$ref": "#/definitions/NumberInput"
21
+ },
22
+ {
23
+ "$ref": "#/definitions/TextInput"
24
+ },
25
+ {
26
+ "$ref": "#/definitions/StatusInput"
27
+ },
28
+ {
29
+ "$ref": "#/definitions/ReminderInput"
30
+ },
31
+ {
32
+ "$ref": "#/definitions/PlayerReminderInput"
33
+ }
34
+ ],
35
+ "definitions": {
36
+ "PlayerInput": {
37
+ "type": "object",
38
+ "properties": {
39
+ "title": {
40
+ "$ref": "#/definitions/__schema0"
41
+ },
42
+ "footer": {
43
+ "$ref": "#/definitions/__schema1"
44
+ },
45
+ "readonly": {
46
+ "$ref": "#/definitions/__schema2"
47
+ },
48
+ "type": {
49
+ "$ref": "#/definitions/__schema3"
50
+ },
51
+ "layout": {
52
+ "$ref": "#/definitions/__schema4"
53
+ },
54
+ "kinds": {
55
+ "$ref": "#/definitions/__schema5"
56
+ },
57
+ "filterToken": {
58
+ "$ref": "#/definitions/__schema6"
59
+ },
60
+ "range": {
61
+ "$ref": "#/definitions/__schema7"
62
+ }
63
+ },
64
+ "required": [
65
+ "type",
66
+ "layout",
67
+ "kinds"
68
+ ],
69
+ "additionalProperties": false,
70
+ "id": "PlayerInput",
71
+ "title": "玩家输入",
72
+ "description": "提供一个玩家的输入,通常用于需要指定玩家的技能选项"
73
+ },
74
+ "__schema0": {
75
+ "type": "string"
76
+ },
77
+ "__schema1": {
78
+ "type": "string"
79
+ },
80
+ "__schema2": {
81
+ "type": "boolean"
82
+ },
83
+ "__schema3": {
84
+ "type": "string",
85
+ "const": "PLAYER"
86
+ },
87
+ "__schema4": {
88
+ "default": "ROUND",
89
+ "type": "string",
90
+ "enum": [
91
+ "ROUND",
92
+ "ROW"
93
+ ]
94
+ },
95
+ "__schema5": {
96
+ "default": [
97
+ "Townsfolk",
98
+ "Outsiders",
99
+ "Minions",
100
+ "Demons"
101
+ ],
102
+ "type": "array",
103
+ "items": {
104
+ "$ref": "#/definitions/CharacterBasicKind"
105
+ }
106
+ },
107
+ "CharacterBasicKind": {
108
+ "type": "string",
109
+ "enum": [
110
+ "Townsfolk",
111
+ "Outsiders",
112
+ "Minions",
113
+ "Demons"
114
+ ],
115
+ "id": "CharacterBasicKind",
116
+ "title": "角色基本类别",
117
+ "description": "角色基本类别定义了游戏中角色的基本分类,通常用于技能选项中需要指定角色类别的情况"
118
+ },
119
+ "__schema6": {
120
+ "type": "string"
121
+ },
122
+ "__schema7": {
123
+ "allOf": [
124
+ {
125
+ "$ref": "#/definitions/Range"
126
+ }
127
+ ]
128
+ },
129
+ "Range": {
130
+ "anyOf": [
131
+ {
132
+ "$ref": "#/definitions/__schema8"
133
+ },
134
+ {
135
+ "$ref": "#/definitions/__schema11"
136
+ }
137
+ ],
138
+ "id": "Range",
139
+ "title": "范围模型",
140
+ "description": "表示一个数值范围,可以是一个固定值或者一个区间"
141
+ },
142
+ "__schema8": {
143
+ "type": "array",
144
+ "items": [
145
+ {
146
+ "$ref": "#/definitions/__schema9"
147
+ },
148
+ {
149
+ "$ref": "#/definitions/__schema10"
150
+ }
151
+ ]
152
+ },
153
+ "__schema9": {
154
+ "type": "number"
155
+ },
156
+ "__schema10": {
157
+ "type": "number"
158
+ },
159
+ "__schema11": {
160
+ "type": "array",
161
+ "items": [
162
+ {
163
+ "type": "number"
164
+ }
165
+ ]
166
+ },
167
+ "CharacterInput": {
168
+ "type": "object",
169
+ "properties": {
170
+ "title": {
171
+ "$ref": "#/definitions/__schema0"
172
+ },
173
+ "footer": {
174
+ "$ref": "#/definitions/__schema1"
175
+ },
176
+ "readonly": {
177
+ "$ref": "#/definitions/__schema2"
178
+ },
179
+ "type": {
180
+ "$ref": "#/definitions/__schema12"
181
+ },
182
+ "kinds": {
183
+ "$ref": "#/definitions/__schema13"
184
+ },
185
+ "filterToken": {
186
+ "$ref": "#/definitions/__schema14"
187
+ },
188
+ "range": {
189
+ "$ref": "#/definitions/__schema15"
190
+ }
191
+ },
192
+ "required": [
193
+ "type",
194
+ "kinds"
195
+ ],
196
+ "additionalProperties": false,
197
+ "id": "CharacterInput",
198
+ "title": "角色输入",
199
+ "description": "提供一个角色的输入,通常用于需要指定角色的技能选项"
200
+ },
201
+ "__schema12": {
202
+ "type": "string",
203
+ "const": "CHARACTER"
204
+ },
205
+ "__schema13": {
206
+ "default": [
207
+ "Townsfolk",
208
+ "Outsiders",
209
+ "Minions",
210
+ "Demons"
211
+ ],
212
+ "type": "array",
213
+ "items": {
214
+ "$ref": "#/definitions/CharacterBasicKind"
215
+ }
216
+ },
217
+ "__schema14": {
218
+ "type": "string"
219
+ },
220
+ "__schema15": {
221
+ "allOf": [
222
+ {
223
+ "$ref": "#/definitions/Range"
224
+ }
225
+ ]
226
+ },
227
+ "AlignmentInput": {
228
+ "type": "object",
229
+ "properties": {
230
+ "title": {
231
+ "$ref": "#/definitions/__schema0"
232
+ },
233
+ "footer": {
234
+ "$ref": "#/definitions/__schema1"
235
+ },
236
+ "readonly": {
237
+ "$ref": "#/definitions/__schema2"
238
+ },
239
+ "type": {
240
+ "$ref": "#/definitions/__schema16"
241
+ }
242
+ },
243
+ "required": [
244
+ "type"
245
+ ],
246
+ "additionalProperties": false,
247
+ "id": "AlignmentInput",
248
+ "title": "阵营选择",
249
+ "description": "提供一个阵营的选择,通常用于需要指定阵营的技能选项"
250
+ },
251
+ "__schema16": {
252
+ "type": "string",
253
+ "const": "ALIGNMENT"
254
+ },
255
+ "CharacterKindInput": {
256
+ "type": "object",
257
+ "properties": {
258
+ "title": {
259
+ "$ref": "#/definitions/__schema0"
260
+ },
261
+ "footer": {
262
+ "$ref": "#/definitions/__schema1"
263
+ },
264
+ "readonly": {
265
+ "$ref": "#/definitions/__schema2"
266
+ },
267
+ "type": {
268
+ "$ref": "#/definitions/__schema17"
269
+ }
270
+ },
271
+ "required": [
272
+ "type"
273
+ ],
274
+ "additionalProperties": false,
275
+ "id": "CharacterKindInput",
276
+ "title": "角色类别输入",
277
+ "description": "提供一个角色类别的输入,通常用于需要指定角色类型的技能选项"
278
+ },
279
+ "__schema17": {
280
+ "type": "string",
281
+ "const": "CHARACTER_KIND"
282
+ },
283
+ "BooleanInput": {
284
+ "type": "object",
285
+ "properties": {
286
+ "title": {
287
+ "$ref": "#/definitions/__schema0"
288
+ },
289
+ "footer": {
290
+ "$ref": "#/definitions/__schema1"
291
+ },
292
+ "readonly": {
293
+ "$ref": "#/definitions/__schema2"
294
+ },
295
+ "type": {
296
+ "$ref": "#/definitions/__schema18"
297
+ },
298
+ "prompt": {
299
+ "$ref": "#/definitions/__schema19"
300
+ },
301
+ "style": {
302
+ "$ref": "#/definitions/__schema20"
303
+ },
304
+ "defaultValue": {
305
+ "$ref": "#/definitions/__schema21"
306
+ },
307
+ "texts": {
308
+ "$ref": "#/definitions/__schema22"
309
+ }
310
+ },
311
+ "required": [
312
+ "type",
313
+ "style",
314
+ "defaultValue",
315
+ "texts"
316
+ ],
317
+ "additionalProperties": false,
318
+ "id": "BooleanInput",
319
+ "title": "布尔选择",
320
+ "description": "提供一个布尔值的选择,通常用于开关类的选项"
321
+ },
322
+ "__schema18": {
323
+ "type": "string",
324
+ "const": "BOOLEAN"
325
+ },
326
+ "__schema19": {
327
+ "type": "string"
328
+ },
329
+ "__schema20": {
330
+ "default": "SWITCH",
331
+ "type": "string",
332
+ "enum": [
333
+ "RADIO",
334
+ "SWITCH"
335
+ ]
336
+ },
337
+ "__schema21": {
338
+ "default": false,
339
+ "type": "boolean"
340
+ },
341
+ "__schema22": {
342
+ "default": [
343
+ "否",
344
+ "是"
345
+ ],
346
+ "type": "array",
347
+ "items": [
348
+ {
349
+ "type": "string"
350
+ },
351
+ {
352
+ "type": "string"
353
+ }
354
+ ]
355
+ },
356
+ "NumberInput": {
357
+ "type": "object",
358
+ "properties": {
359
+ "title": {
360
+ "$ref": "#/definitions/__schema0"
361
+ },
362
+ "footer": {
363
+ "$ref": "#/definitions/__schema1"
364
+ },
365
+ "readonly": {
366
+ "$ref": "#/definitions/__schema2"
367
+ },
368
+ "type": {
369
+ "$ref": "#/definitions/__schema23"
370
+ },
371
+ "range": {
372
+ "$ref": "#/definitions/__schema24"
373
+ },
374
+ "style": {
375
+ "$ref": "#/definitions/__schema25"
376
+ }
377
+ },
378
+ "required": [
379
+ "type",
380
+ "range",
381
+ "style"
382
+ ],
383
+ "additionalProperties": false,
384
+ "id": "NumberInput",
385
+ "title": "数字输入",
386
+ "description": "提供一个数字的输入,通常用于需要指定数值的技能选项"
387
+ },
388
+ "__schema23": {
389
+ "type": "string",
390
+ "const": "NUMBER"
391
+ },
392
+ "__schema24": {
393
+ "default": [
394
+ 1
395
+ ],
396
+ "allOf": [
397
+ {
398
+ "$ref": "#/definitions/Range"
399
+ }
400
+ ]
401
+ },
402
+ "__schema25": {
403
+ "default": "SELECTION",
404
+ "type": "string",
405
+ "enum": [
406
+ "SELECTION",
407
+ "INPUT"
408
+ ]
409
+ },
410
+ "TextInput": {
411
+ "type": "object",
412
+ "properties": {
413
+ "title": {
414
+ "$ref": "#/definitions/__schema0"
415
+ },
416
+ "footer": {
417
+ "$ref": "#/definitions/__schema1"
418
+ },
419
+ "readonly": {
420
+ "$ref": "#/definitions/__schema2"
421
+ },
422
+ "type": {
423
+ "$ref": "#/definitions/__schema26"
424
+ }
425
+ },
426
+ "required": [
427
+ "type"
428
+ ],
429
+ "additionalProperties": false,
430
+ "id": "TextInput",
431
+ "title": "文本输入",
432
+ "description": "提供一个文本的输入,通常用于需要指定文本的技能选项"
433
+ },
434
+ "__schema26": {
435
+ "type": "string",
436
+ "const": "TEXT"
437
+ },
438
+ "StatusInput": {
439
+ "type": "object",
440
+ "properties": {
441
+ "title": {
442
+ "$ref": "#/definitions/__schema0"
443
+ },
444
+ "footer": {
445
+ "$ref": "#/definitions/__schema1"
446
+ },
447
+ "readonly": {
448
+ "$ref": "#/definitions/__schema2"
449
+ },
450
+ "type": {
451
+ "$ref": "#/definitions/__schema27"
452
+ }
453
+ },
454
+ "required": [
455
+ "type"
456
+ ],
457
+ "additionalProperties": false,
458
+ "id": "StatusInput",
459
+ "title": "状态输入",
460
+ "description": "提供一个状态的输入,通常用于需要指定状态的技能选项"
461
+ },
462
+ "__schema27": {
463
+ "type": "string",
464
+ "const": "STATUS"
465
+ },
466
+ "ReminderInput": {
467
+ "type": "object",
468
+ "properties": {
469
+ "title": {
470
+ "$ref": "#/definitions/__schema0"
471
+ },
472
+ "footer": {
473
+ "$ref": "#/definitions/__schema1"
474
+ },
475
+ "readonly": {
476
+ "$ref": "#/definitions/__schema2"
477
+ },
478
+ "type": {
479
+ "$ref": "#/definitions/__schema28"
480
+ }
481
+ },
482
+ "required": [
483
+ "type"
484
+ ],
485
+ "additionalProperties": false,
486
+ "id": "ReminderInput",
487
+ "title": "提示输入",
488
+ "description": "提供一个提示的输入,通常用于需要给玩家展示信息的技能选项"
489
+ },
490
+ "__schema28": {
491
+ "type": "string",
492
+ "const": "REMINDER"
493
+ },
494
+ "PlayerReminderInput": {
495
+ "type": "object",
496
+ "properties": {
497
+ "title": {
498
+ "$ref": "#/definitions/__schema0"
499
+ },
500
+ "footer": {
501
+ "$ref": "#/definitions/__schema1"
502
+ },
503
+ "readonly": {
504
+ "$ref": "#/definitions/__schema2"
505
+ },
506
+ "type": {
507
+ "$ref": "#/definitions/__schema29"
508
+ }
509
+ },
510
+ "required": [
511
+ "type"
512
+ ],
513
+ "additionalProperties": false,
514
+ "id": "PlayerReminderInput",
515
+ "title": "玩家提示输入",
516
+ "description": "提供一个玩家提示的输入,通常用于需要给特定玩家展示信息的技能选项"
517
+ },
518
+ "__schema29": {
519
+ "type": "string",
520
+ "const": "PLAYER_REMINDER"
521
+ }
522
+ }
523
+ }