This commit is contained in:
2026-04-21 23:28:49 +07:00
parent 3a687a4d58
commit 8de65bb527
45 changed files with 1056 additions and 551 deletions

View File

@@ -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;