Files
privacy.sexy/src/application/State/Selection/SelectedScript.ts
2020-07-19 02:26:56 +01:00

15 lines
436 B
TypeScript

import { BaseEntity } from '@/infrastructure/Entity/BaseEntity';
import { IScript } from '@/domain/IScript';
export class SelectedScript extends BaseEntity<string> {
constructor(
public readonly script: IScript,
public readonly revert: boolean,
) {
super(script.id);
if (revert && !script.canRevert()) {
throw new Error('cannot revert an irreversible script');
}
}
}