private void DetachCombination(Combination combination) { combination.Player = null; OnPropertyChanged("Combinations"); }
private void OnGameSetted() { string[] names = { "Total des As", "Total des Deux", "Total des Trois", "Total des Quatre", "Total des Cinq", "Total des Six", "Brelan", "Carré", "Full", "Petite suite", "Grande suite", "Yahtzee", "Chance", }; string[] descriptions = { "Somme des dés 1", "Somme des dés 2", "Somme des dés 3", "Somme des dés 4", "Somme des dés 5", "Somme des dés 6", "3 dés identiques (somme des 5 dés)", "4 dés identiques (somme des 5 dés)", "Un brelan plus une paire (25 points)", "Suite de 4 dés (30 points)", "Suite de 5 dés (40 points)", "5 dés identiques (50 points)", "Somme des 5 dés", }; string[] groups = { "upper", "upper", "upper", "upper", "upper", "upper", "lower", "lower", "lower", "lower", "lower", "lower", "lower", }; string[] methodes = {"calculateAces", "calculateTwos", "calculateThrees", "calculateFours", "calculateFives", "calculateSixes", "calculateThreeOfAKind", "calculateFourOfAKind", "calculateFullHouse", "calculateSmallStraight", "calculateLargeStraight", "calculateYahtzee", "calculateChance" }; Func<Dice[], int>[] delegates = new Func<Dice[], int>[] { new Func<Dice[], int>(Game.calculateAces), new Func<Dice[], int>(Game.calculateTwos), new Func<Dice[], int>(Game.calculateThrees), new Func<Dice[], int>(Game.calculateFours), new Func<Dice[], int>(Game.calculateFives), new Func<Dice[], int>(Game.calculateSixes), new Func<Dice[], int>(Game.calculateThreeOfAKind), new Func<Dice[], int>(Game.calculateFourOfAKind), new Func<Dice[], int>(Game.calculateFullHouse), new Func<Dice[], int>(Game.calculateSmallStraight), new Func<Dice[], int>(Game.calculateLargeStraight), new Func<Dice[], int>(Game.calculateYahtzee), new Func<Dice[], int>(Game.calculateChance) }; for (int i = 0; i < names.Length; i++) { Combination combination = new Combination(names[i], descriptions[i], groups[i], delegates[i]); this._aCombinations.Add(combination); } }
private void AttachCombination(Combination combination) { combination.Player = this; OnPropertyChanged("Combinations"); }