boardgame-core/src/utils/rng.ts

12 lines
304 B
TypeScript
Raw Normal View History

2026-04-01 13:36:16 +08:00
export interface RNG {
/** 设置随机数种子 */
(seed: number): void;
/** 获取一个[0,1)随机数 */
next(max?: number): number;
/** 获取一个[0,max)随机整数 */
nextInt(max: number): number;
}
// TODO: create a RNG implementation with the alea library