ds4/src/module/rolls/roll-provider.ts
2020-12-31 02:27:21 +01:00

16 lines
375 B
TypeScript

export class DS4RollProvider {
getNextRoll(): number {
return new Roll("1d20").roll().total;
}
getNextRolls(amount: number): Array<number> {
return Array(amount)
.fill(0)
.map(() => this.getNextRoll());
}
}
export interface RollProvider {
getNextRoll(): number;
getNextRolls(number: number): Array<number>;
}