feat: design game file and parse it to mongo

* 取消用 README 來寫關卡說明
This commit is contained in:
wancat committed 2023-08-08 20:38:27 +08:00
1 parent 6204bd0b17
commit 0de4b6ac9d
4 files changed
+61 -20

No files matched your search

+31 -1
View File
@@ -1,12 +1,42 @@
import { model, Schema } from 'mongoose'
const stageSchema = new Schema({
name: {
type: String,
required: true,
},
condition: {
command: {
type: [String],
required: false,
},
output: {
type: [String],
required: false,
},
error: {
type: [String],
required: false,
},
},
responses: {
type: [String],
required: true,
},
hint: {
type: [String],
required: true,
},
})
const Quest = model(
'Quest',
new Schema({
_id: String,
title: String,
order: Number,
content: String,
introduction: String,
stages: [stageSchema],
})
)