Ejemplo n.º 1
0
        private void Confirmer(object sender, RoutedEventArgs e)
        {
            ComboBoxItem typeItem = (ComboBoxItem)Choix.SelectedItem;
            string       choix    = typeItem.Content.ToString();
            string       critere  = (string)Trie.SelectionBoxItem;

            if (choix == "Vampire")
            {
                if (critere == "Cagnotte")
                {
                    VampireSortByCagnotte ctr = new VampireSortByCagnotte();
                    admin.EquipeVampire.Sort(ctr);
                    AfficherVampire();
                }
                if (critere == "Indice luminosité")
                {
                    VampireSortByIndiceLuminosite ctr = new VampireSortByIndiceLuminosite();
                    admin.EquipeVampire.Sort(ctr);
                    AfficherVampire();
                }
            }
            if (choix == "Zombie")
            {
                if (critere == "Cagnotte")
                {
                    Zombie_SortByCagnotte ctr = new Zombie_SortByCagnotte();
                    admin.EquipeZombie.Sort(ctr);
                    AfficherZombie();
                }
                if (critere == "Degré de décomposition")
                {
                    ZombieSortByDegreDecomposition ctr = new ZombieSortByDegreDecomposition();
                    admin.EquipeZombie.Sort(ctr);
                    AfficherZombie();
                }
            }
            if (choix == "Loup Garou")
            {
                if (critere == "Cagnotte")
                {
                    LoupGarouSortByCagnotte ctr = new LoupGarouSortByCagnotte();
                    admin.EquipeLoupGarou.Sort(ctr);
                    AfficherLoupGarou();
                }
                if (critere == "Indice cruauté")
                {
                    LoupGarouSortByIndiceCruaute ctr = new LoupGarouSortByIndiceCruaute();
                    admin.EquipeLoupGarou.Sort(ctr);
                    AfficherLoupGarou();
                }
            }
            if (choix == "Fantôme")
            {
                if (critere == "Cagnotte")
                {
                    FantomeSortByCagnotte ctr = new FantomeSortByCagnotte();
                    admin.EquipeFantome.Sort(ctr);
                    AfficherFantome();
                }
            }
            if (choix == "Démon")
            {
                if (critere == "Cagnotte")
                {
                    DemonSortByCagnotte ctr = new DemonSortByCagnotte();
                    admin.EquipeDemon.Sort(ctr);
                    AfficherDemon();
                }
                if (critere == "Force")
                {
                    Demon_SortByForce ctr = new Demon_SortByForce();
                    admin.EquipeDemon.Sort(ctr);
                    AfficherDemon();
                }
            }
            MessageBox.Show("Tri effectué.");
        }
Ejemplo n.º 2
0
        public void TriZombieSelonCagnotte()
        {
            Zombie_SortByCagnotte critere = new Zombie_SortByCagnotte();

            this.equipeZombie.Sort(critere);
        }