1
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import type {
|
||||
RuntimeRepositoryPort,
|
||||
SavedSnapshot,
|
||||
} from '../runtimeRepository.js';
|
||||
import type { ProfileSaveArchiveSummary } from '../../../../packages/shared/src/contracts/runtime.js';
|
||||
|
||||
/**
|
||||
* RPG 继续游戏归档仓储端口。
|
||||
* 当前仍由 runtimeRepository 提供真实实现,本文件只建立按领域命名的兼容入口。
|
||||
*/
|
||||
export type RpgSaveArchiveRepositoryPort = Pick<
|
||||
RuntimeRepositoryPort,
|
||||
'listProfileSaveArchives' | 'resumeProfileSaveArchive'
|
||||
>;
|
||||
export type RpgSaveArchiveSnapshot = SavedSnapshot;
|
||||
|
||||
export class RpgSaveArchiveRepository implements RpgSaveArchiveRepositoryPort {
|
||||
constructor(private readonly runtimeRepository: RuntimeRepositoryPort) {}
|
||||
|
||||
listProfileSaveArchives(userId: string): Promise<ProfileSaveArchiveSummary[]> {
|
||||
return this.runtimeRepository.listProfileSaveArchives(userId);
|
||||
}
|
||||
|
||||
resumeProfileSaveArchive(
|
||||
userId: string,
|
||||
worldKey: string,
|
||||
): Promise<
|
||||
| {
|
||||
entry: ProfileSaveArchiveSummary;
|
||||
snapshot: RpgSaveArchiveSnapshot;
|
||||
}
|
||||
| null
|
||||
> {
|
||||
return this.runtimeRepository.resumeProfileSaveArchive(userId, worldKey);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user