Skip to content

Instantly share code, notes, and snippets.

@col000r
col000r / ShuffleBag.cs
Last active February 19, 2024 14:23 — forked from mstevenson/ShuffleBag.cs
Added a constructor that lets you fill your shufflebag during creation like so: ShuffleBag<int> intBag = new ShuffleBag<int>(new int[] {1, 2, 3, 4, 5});
//https://gist.github.com/col000r/6658520
//but all the hard work done by mstevenson: https://gist.github.com/mstevenson/4050130
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class ShuffleBag<T> : ICollection<T>, IList<T> {
private List<T> data = new List<T> ();
private int cursor = 0;