# HG changeset patch # User alys # Date 2021-03-15 07:30:46 # Node ID 1534e3dc82f341af2d09f4c7b79abe844bc37044 # Parent baefa0f9d7f6946b4f638414c2ec60951002ab12 Add Extensions class I left out. diff --git a/isometric-park-fna/Utils/Extensions.cs b/isometric-park-fna/Utils/Extensions.cs new file mode 100644 --- /dev/null +++ b/isometric-park-fna/Utils/Extensions.cs @@ -0,0 +1,26 @@ + +using System; +using System.Collections.Generic; + + +namespace isometricparkfna +{ + public static class Extensions + { + public static List Shuffle (this List source) { + Random rnd = new Random(); + + for(int i = (source.Count-1); i >= 0 ; i--) { + var j = rnd.Next(0, (source.Count-1)); + var tmp = source[j]; + source[j] = source[i]; + source[i] = tmp; + } + + + return source; + + } + } +} +