// START a FLOAT SHUFFLE BAG // Note the a value can be shuffled with himself public ShuffleBagCollection <float> ShuffleBag(float[] values) { var bag = new ShuffleBagCollection <float>(); foreach (var x in values) { bag.Add(x); } return(bag); }
// START a WIGHTED FLOAT SHUFFLE BAG, the trick is the it is added many times // Note the a value can be shuffled with himself public ShuffleBagCollection <float> ShuffleBag(Dictionary <float, int> dict) { ShuffleBagCollection <float> bag = new ShuffleBagCollection <float>(); foreach (KeyValuePair <float, int> x in dict) { //Debug.Log(x.Value); int val = x.Value; float key = x.Key; bag.Add(key, val); } return(bag); }
// START a WIGHTED FLOAT SHUFFLE BAG, the trick is the it is added many times // Note the a value can be shuffled with himself public ShuffleBagCollection <float> ShuffleBag(Dictionary <float, int> dict) { var bag = new ShuffleBagCollection <float>(); foreach (var x in dict) { //Debug.Log(x.Value); var val = x.Value; var key = x.Key; bag.Add(key, val); } return(bag); }
// START a WIGHTED FLOAT SHUFFLE BAG, the trick is the it is added many times // Note the a value can be shuffled with himself public ShuffleBagCollection<float> ShuffleBag(Dictionary<float,int> dict) { ShuffleBagCollection<float> bag = new ShuffleBagCollection<float>(); foreach (KeyValuePair<float, int> x in dict) { //Debug.Log(x.Value); int val = x.Value; float key = x.Key; bag.Add( key, val); } return bag; }
// START a FLOAT SHUFFLE BAG // Note the a value can be shuffled with himself public ShuffleBagCollection<float> ShuffleBag(float[] values) { ShuffleBagCollection<float> bag = new ShuffleBagCollection<float>(); foreach (float x in values) { bag.Add(x); } return bag; }