12 lines
304 B
TypeScript
12 lines
304 B
TypeScript
|
|
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
|