From 529b725161be52fa233fcbde49582ea4acf825aa Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 4 Jan 2020 21:55:10 +0100 Subject: [PATCH] added random vector method --- MLEM.Extended/Extensions/RandomExtensions.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MLEM.Extended/Extensions/RandomExtensions.cs b/MLEM.Extended/Extensions/RandomExtensions.cs index d55b797..efc9327 100644 --- a/MLEM.Extended/Extensions/RandomExtensions.cs +++ b/MLEM.Extended/Extensions/RandomExtensions.cs @@ -1,4 +1,5 @@ using System; +using Microsoft.Xna.Framework; using MonoGame.Extended; namespace MLEM.Extended.Extensions { @@ -12,5 +13,9 @@ namespace MLEM.Extended.Extensions { return random.NextSingle(range.Min, range.Max); } + public static Vector2 Vector2(this Random random, float min, float max) { + return new Vector2(random.NextSingle(min, max), random.NextSingle(min, max)); + } + } } \ No newline at end of file