mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
refactor: add new name "Event" for the set Stage and Exception
This commit is contained in:
1 parent
6e804f0ed4
commit
2dc40a2254
5 files changed
+13
-13
No files matched your search
@@ -37,7 +37,7 @@ export class Quest {
|
||||
)
|
||||
}
|
||||
|
||||
async findSatisfiedStage(
|
||||
async findSatisfiedEvent(
|
||||
command: ICommand,
|
||||
completed: string[]
|
||||
): Promise<string | null> {
|
||||
|
||||
@@ -12,15 +12,15 @@ export class Session implements ISession {
|
||||
private quest: Quest
|
||||
|
||||
constructor(
|
||||
{ completedStages }: ISession,
|
||||
{ completedEvents }: ISession,
|
||||
quest: IQuest,
|
||||
checker: IFileExistenceChecker
|
||||
) {
|
||||
this.completed = completedStages
|
||||
this.completed = completedEvents
|
||||
this.quest = new Quest(quest, checker)
|
||||
}
|
||||
|
||||
get completedStages() {
|
||||
get completedEvents() {
|
||||
return this.completed
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export class Session implements ISession {
|
||||
}
|
||||
|
||||
async runCommand(command: ICommand) {
|
||||
const stageId = await this.quest.findSatisfiedStage(command, this.completed)
|
||||
const stageId = await this.quest.findSatisfiedEvent(command, this.completed)
|
||||
if (stageId) {
|
||||
this.complete(stageId)
|
||||
}
|
||||
|
||||
@@ -12,5 +12,5 @@ export interface ICommand {
|
||||
}
|
||||
|
||||
export interface ISession {
|
||||
completedStages: string[]
|
||||
completedEvents: string[]
|
||||
}
|
||||
Reference in new issue
Block a user