Cleanup Utility.cs
This commit is contained in:
parent
7e3034a300
commit
1e24da5312
|
@ -1,11 +1,11 @@
|
|||
using System;
|
||||
using RimWorld;
|
||||
using RimWorld;
|
||||
using System;
|
||||
|
||||
namespace RJWSexperience
|
||||
{
|
||||
public static class Utility
|
||||
{
|
||||
public static System.Random random = new System.Random(Environment.TickCount);
|
||||
private static readonly Random random = new Random(Environment.TickCount);
|
||||
|
||||
public static float RandGaussianLike(float min, float max, int iterations = 3)
|
||||
{
|
||||
|
@ -14,9 +14,9 @@ namespace RJWSexperience
|
|||
{
|
||||
res += random.NextDouble();
|
||||
}
|
||||
res = res / iterations;
|
||||
res /= iterations;
|
||||
|
||||
return (float)res * (max - min) + min;
|
||||
return ((float)res).Denormalization(min, max);
|
||||
}
|
||||
|
||||
public static void SetTo(this Pawn_RecordsTracker records, RecordDef record, float value)
|
||||
|
@ -32,7 +32,7 @@ namespace RJWSexperience
|
|||
|
||||
public static float Denormalization(this float num, float min, float max)
|
||||
{
|
||||
return num * (max - min) + min;
|
||||
return (num * (max - min)) + min;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue