private void ShuffleNobles() { Random random = new Random(Guid.NewGuid().GetHashCode()); List <Noble> newNobles = new List <Noble>(); for (int i = 0; i < DeckNoble.Count; i++) { int max = DeckNoble.Count - (i + 1); int index = random.Next(0, max); newNobles.Add(DeckNoble[index]); DeckNoble.RemoveAt(index); } DeckNoble = newNobles; }
private void initializeNoble() { List <List <int> > intNoble = FileReader.ReadFile(NobleAddress); //Creating and setting the nobles for (int i = 0; i < intNoble.Count; i++) { DeckNoble.Add(new Noble(intNoble[i])); } //Shuffling the nobles ShuffleNobles(); //Turning X nobles for the board for (int i = 0; i < NumberOfNoblesShown; i++) { DisplayNoble.Add(DeckNoble[0]); DeckNoble.RemoveAt(0); } }