mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +01:00
21 lines
No EOL
630 B
C#
21 lines
No EOL
630 B
C#
using System;
|
|
using Microsoft.Xna.Framework;
|
|
using MonoGame.Extended;
|
|
|
|
namespace MLEM.Extended.Extensions {
|
|
public static class RandomExtensions {
|
|
|
|
public static int Range(this Random random, Range<int> range) {
|
|
return random.Next(range.Min, range.Max);
|
|
}
|
|
|
|
public static float Range(this Random random, Range<float> range) {
|
|
return random.NextSingle(range.Min, range.Max);
|
|
}
|
|
|
|
public static Vector2 NextVector2(this Random random, float min, float max) {
|
|
return new Vector2(random.NextSingle(min, max), random.NextSingle(min, max));
|
|
}
|
|
|
|
}
|
|
} |