Third Party billing info
示例#1
0
 // Sampled a N-sample probability density function in the range [-1024..1024]
 // 1 sample produces a rectangular probability
 // 2 samples produces a triangular probability
 // ...
 // N samples approximates a true gaussian
 public static WRange FromPDF(Thirdparty.Random r, int samples)
 {
     return new WRange(Exts.MakeArray(samples, _ => r.Next(-1024, 1024))
         .Sum() / samples);
 }
示例#2
0
 public static int2 ChooseRandomCell(this World w, Thirdparty.Random r)
 {
     return new int2(
         r.Next(w.Map.XOffset, w.Map.XOffset + w.Map.Width),
         r.Next(w.Map.YOffset, w.Map.YOffset + w.Map.Height));
 }
示例#3
0
 // Sampled a N-sample probability density function in the range [-1024..1024, -1024..1024]
 // 1 sample produces a rectangular probability
 // 2 samples produces a triangular probability
 // ...
 // N samples approximates a true gaussian
 public static WVec FromPDF(Thirdparty.Random r, int samples)
 {
     return new WVec(WRange.FromPDF(r, samples), WRange.FromPDF(r, samples), WRange.Zero);
 }
示例#4
0
 public static int2 ChooseRandomCell(this World w, Thirdparty.Random r)
 {
     return new int2(
         r.Next(w.Map.Bounds.Left, w.Map.Bounds.Right),
         r.Next(w.Map.Bounds.Top, w.Map.Bounds.Bottom));
 }