16 lines
375 B
TypeScript
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>;
|
|
}
|