From 69fd9797d0fe7cb7070a23fa61dd8a6368c624a3 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 4 Dec 2019 13:06:53 +0100 Subject: [PATCH] random extensions --- MLEM.Extended/Extensions/RandomExtensions.cs | 16 ++++++++++++++++ MLEM.Extended/MLEM.Extended.csproj | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 MLEM.Extended/Extensions/RandomExtensions.cs diff --git a/MLEM.Extended/Extensions/RandomExtensions.cs b/MLEM.Extended/Extensions/RandomExtensions.cs new file mode 100644 index 0000000..d55b797 --- /dev/null +++ b/MLEM.Extended/Extensions/RandomExtensions.cs @@ -0,0 +1,16 @@ +using System; +using MonoGame.Extended; + +namespace MLEM.Extended.Extensions { + public static class RandomExtensions { + + public static int Range(this Random random, Range range) { + return random.Next(range.Min, range.Max); + } + + public static float Range(this Random random, Range range) { + return random.NextSingle(range.Min, range.Max); + } + + } +} \ No newline at end of file diff --git a/MLEM.Extended/MLEM.Extended.csproj b/MLEM.Extended/MLEM.Extended.csproj index 70b9355..f344cd9 100644 --- a/MLEM.Extended/MLEM.Extended.csproj +++ b/MLEM.Extended/MLEM.Extended.csproj @@ -14,14 +14,14 @@ - - + + all - + \ No newline at end of file