From 6e804f0ed44aa8a84ce43d8317963ee06e9d289c Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Mon, 21 Apr 2025 11:53:32 +0800 Subject: [PATCH] refactor: reuse satisfies function in condition --- packages/game/src/Stage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/game/src/Stage.ts b/packages/game/src/Stage.ts index ff7633c..d0c250f 100644 --- a/packages/game/src/Stage.ts +++ b/packages/game/src/Stage.ts @@ -5,7 +5,7 @@ import { StageException } from './schema/exception' export class Stage { id: string name: string - private condition: Condition + public readonly condition: Condition private requirements: string[] public readonly exceptions: StageException[] @@ -21,7 +21,7 @@ export class Stage { command: ICommand, checker: IFileExistenceChecker ): Promise { - return this.condition.match(command) && this.condition.check(checker) + return this.condition.satisfies(command, checker) } private checkRequirements(completed: string[]): boolean {