Update
This commit is contained in:
@@ -2,19 +2,13 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Hallucinate.GameSetup.Maze.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides utility extension methods for maze generation algorithms.
|
||||
/// </summary>
|
||||
public static class Extensions
|
||||
public static class ListExtensions
|
||||
{
|
||||
private static System.Random _rng = new System.Random();
|
||||
|
||||
/// <summary>
|
||||
/// Shuffles the elements of an <see cref="IList{T}"/> using the Fisher-Yates algorithm.
|
||||
/// This is used to randomize directions for maze generation.
|
||||
/// Shuffles a list using the Fisher-Yates algorithm.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of elements in the list.</typeparam>
|
||||
/// <param name="list">The list to shuffle.</param>
|
||||
public static void Shuffle<T>(this IList<T> list)
|
||||
{
|
||||
int n = list.Count;
|
||||
|
||||
Reference in New Issue
Block a user