mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
refactor: game
This commit is contained in:
1 parent
2d05149cea
commit
4c421b4cb3
9 files changed
+181
-85
No files matched your search
@@ -3,10 +3,9 @@ import { conditionSchema, ICondition } from './condition.js'
|
||||
import { responseSchema, IResponse } from './response.js'
|
||||
import { hintSchema, IHint } from './hint.js'
|
||||
|
||||
export interface ICommandResponder {
|
||||
export interface ICommandResponder extends IHint {
|
||||
condition?: ICondition
|
||||
responses: IResponse[]
|
||||
hints?: IHint[]
|
||||
}
|
||||
|
||||
export const commandResponderSchema = new Schema<ICommandResponder>({
|
||||
|
||||
@@ -2,10 +2,14 @@ import mongoose from 'mongoose'
|
||||
|
||||
export { User, IUser } from './user.js'
|
||||
export { Quest, IQuest } from './quest.js'
|
||||
export { Session, ISession } from './session.js'
|
||||
export { Session, ISession, ITask } from './session.js'
|
||||
export { Command, ICommand } from './command.js'
|
||||
export { UserProfile, IUserProfile } from './userProfile.js'
|
||||
export { IFileCondition, ICondition } from './condition.js'
|
||||
export { IStage } from './stage.js'
|
||||
export { IRequirement } from './requirement.js'
|
||||
export { IResponse } from './response.js'
|
||||
export { IException } from './exception.js'
|
||||
|
||||
export default async function connectDB(uri: string) {
|
||||
const db = await mongoose.connect(uri)
|
||||
|
||||
@@ -42,6 +42,7 @@ const taskSchema = new Schema<ITask>({
|
||||
})
|
||||
|
||||
export interface ISession {
|
||||
_id: Types.ObjectId
|
||||
user: Types.ObjectId
|
||||
quest: string
|
||||
containerId: string | null
|
||||
|
||||
Reference in new issue
Block a user