Skip to content

Commit

Permalink
Move Range methods to Generators namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Majiir committed Sep 4, 2014
1 parent 6fda1ca commit a1610c2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
16 changes: 16 additions & 0 deletions Plugin/Generators/RandomExtensions.cs
@@ -0,0 +1,16 @@

namespace Kethane.Generators
{
internal static class RandomExtensions
{
public static float Range(this System.Random random, float min, float max)
{
return (float)random.Range((double)min, max);
}

public static double Range(this System.Random random, double min, double max)
{
return random.NextDouble() * (max - min) + min;
}
}
}
1 change: 1 addition & 0 deletions Plugin/Kethane.csproj
Expand Up @@ -53,6 +53,7 @@
<Compile Include="EnumerableExtensions\Pair.cs" />
<Compile Include="EnumerableExtensions\Repeat.cs" />
<Compile Include="EnumerableExtensions\ReverseComparer.cs" />
<Compile Include="Generators\RandomExtensions.cs" />
<Compile Include="GeodesicGrid\BoundsMap.cs" />
<Compile Include="GeodesicGrid\Cell.cs" />
<Compile Include="Generators\CellularResourceGenerator.cs" />
Expand Down
10 changes: 0 additions & 10 deletions Plugin/Misc.cs
Expand Up @@ -33,16 +33,6 @@ public static AnimationState[] SetUpAnimation(string animationName, Part part)
return states.ToArray();
}

public static float Range(this System.Random random, float min, float max)
{
return (float)random.Range((double)min, max);
}

public static double Range(this System.Random random, double min, double max)
{
return random.NextDouble() * (max - min) + min;
}

public static void Add<T>(this List<T> list, params T[] values)
{
list.AddRange(values);
Expand Down

0 comments on commit a1610c2

Please sign in to comment.