2023-04-27 16:36:05 +03:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace DotRecast.Core
|
|
|
|
|
{
|
|
|
|
|
public class FRand
|
|
|
|
|
{
|
2023-05-06 05:44:57 +03:00
|
|
|
|
private readonly Random _r;
|
2023-04-27 16:36:05 +03:00
|
|
|
|
|
|
|
|
|
public FRand()
|
|
|
|
|
{
|
2023-05-06 05:44:57 +03:00
|
|
|
|
_r = new Random();
|
2023-04-27 16:36:05 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public FRand(long seed)
|
|
|
|
|
{
|
2023-05-06 05:44:57 +03:00
|
|
|
|
_r = new Random((int)seed); // TODO : 랜덤 시드 확인 필요
|
2023-04-27 16:36:05 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-06 05:44:57 +03:00
|
|
|
|
public float Next()
|
2023-04-27 16:36:05 +03:00
|
|
|
|
{
|
2023-05-06 05:44:57 +03:00
|
|
|
|
return (float)_r.NextDouble();
|
2023-04-27 16:36:05 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|