This commit is contained in:
16
src/services/storyEngine/scenarioPackRegistry.ts
Normal file
16
src/services/storyEngine/scenarioPackRegistry.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { ScenarioPack } from '../../types';
|
||||
|
||||
const scenarioPackRegistry = new Map<string, ScenarioPack>();
|
||||
|
||||
export function registerScenarioPack(pack: ScenarioPack) {
|
||||
scenarioPackRegistry.set(pack.id, pack);
|
||||
return pack;
|
||||
}
|
||||
|
||||
export function resolveScenarioPack(id: string | null | undefined) {
|
||||
return id ? scenarioPackRegistry.get(id) ?? null : null;
|
||||
}
|
||||
|
||||
export function listScenarioPacks() {
|
||||
return [...scenarioPackRegistry.values()];
|
||||
}
|
||||
Reference in New Issue
Block a user