Example #1
0
 /// <summary>
 /// Shuffles the deck using the elected shuffler algorithm.
 /// You can create your own shuffle algorithms by implementing the IShuffleAlgortihm interface.
 /// </summary>
 public void Shuffle()
 {
     myShuffler.Shuffle(ref TheDeck);
 }
 public virtual IEnumerable <T> Shuffle <T>(IEnumerable <T> collection, IShuffleAlgorithm algorithm)
 {
     return(algorithm.Shuffle(collection));
 }
Example #3
0
        public static IEnumerable <T> Shuffle <T>(this IEnumerable <T> items, IShuffleAlgorithm shuffleAlgorithm)
        {
            var shuffledItems = shuffleAlgorithm.Shuffle(items);

            return(shuffledItems);
        }
 public virtual IEnumerable <T> Shuffle <T>(IEnumerable <T> collection)
 {
     return(_defaultAlgorithm.Shuffle(collection));
 }