public void sortDices() { var listOfDices = DicesForRolling.ToList(); listOfDices.Sort((d1, d2) => d1.number.CompareTo(d2.number)); DicesForRolling = new BindingList <Dice>(listOfDices); }
public void moveFromRollingToChances() { /* Kostki z tym numerem są przenoszone z puli kostek rzucanych do puli szans na rzuty*/ var dices = DicesForRolling.ToList().FindAll((d) => { return(d.number == choosenNumber); }); var dicesList1 = DicesWithChanceForRolling.ToList(); dicesList1.AddRange((dices)); DicesWithChanceForRolling = new BindingList <Dice>(dicesList1); var dicesList2 = DicesForRolling.ToList(); dicesList2.RemoveAll((d) => { return(d.number == choosenNumber); }); DicesForRolling = new BindingList <Dice>(dicesList2); }