Example #1
0
 public JediViewModel(EntitiesLayer.Jedi jedi)
 {
     m_jedi = jedi;
 }
        private void ButtonStart_Event(object sender, EventArgs e)
        {
            if (BusinessLayer.PartieManager.getCurrentGame().Mode == EntitiesLayer.Mode.Multi || BusinessLayer.PartieManager.getCurrentGame().Mode == EntitiesLayer.Mode.Solo)
            {
                if (BusinessLayer.PartieManager.getCurrentGame().Current_match.JediVainqueur == null)
                {
                    if (((BusinessLayer.PartieManager.getCurrentGame().J1 != null && BusinessLayer.PartieManager.getCurrentGame().Current_match.Jedi1.Nom == BusinessLayer.PartieManager.getCurrentGame().Jedi_j1.Nom) ||
                         (BusinessLayer.PartieManager.getCurrentGame().J2 != null && BusinessLayer.PartieManager.getCurrentGame().Current_match.Jedi1.Nom == BusinessLayer.PartieManager.getCurrentGame().Jedi_j2.Nom)) &&
                        (BusinessLayer.PartieManager.getCurrentGame().Mode.Equals(EntitiesLayer.Mode.Solo) || BusinessLayer.PartieManager.getCurrentGame().Mode.Equals(EntitiesLayer.Mode.Multi)))
                    {
                        Affiche1.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        BusinessLayer.PartieManager.getCurrentGame().Choice_j1 = BusinessLayer.PartieManager.getIAChoice();
                    }

                    if (((BusinessLayer.PartieManager.getCurrentGame().J1 != null && BusinessLayer.PartieManager.getCurrentGame().Current_match.Jedi2.Nom == BusinessLayer.PartieManager.getCurrentGame().Jedi_j1.Nom) ||
                         (BusinessLayer.PartieManager.getCurrentGame().J2 != null && BusinessLayer.PartieManager.getCurrentGame().Current_match.Jedi2.Nom == BusinessLayer.PartieManager.getCurrentGame().Jedi_j2.Nom)) &&
                        (BusinessLayer.PartieManager.getCurrentGame().Mode.Equals(EntitiesLayer.Mode.Solo) || BusinessLayer.PartieManager.getCurrentGame().Mode.Equals(EntitiesLayer.Mode.Multi)))
                    {
                        Affiche2.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        BusinessLayer.PartieManager.getCurrentGame().Choice_j2 = BusinessLayer.PartieManager.getIAChoice();
                    }

                    resolve();
                }
            }
            else
            {
                Bourse_j1_LostFocus(this, null);
                Bourse_j2_LostFocus(this, null);

                if (BusinessLayer.PartieManager.getCurrentGame().Current_match.JediVainqueur == null)
                {
                    BusinessLayer.JediTournamentManager jtm = new BusinessLayer.JediTournamentManager();
                    resolve();
                    EntitiesLayer.Jedi winner = BusinessLayer.PartieManager.getCurrentGame().Current_match.JediVainqueur;

                    if (BusinessLayer.PartieManager.getCurrentGame().J1 != null &&
                        (this.J1Jedi.ComboJedi.SelectedItem as ViewModel.Jedi.JediViewModel) != null &&
                        BusinessLayer.PartieManager.getCurrentGame().Pari_j1 != 0)
                    {
                        if ((this.J1Jedi.ComboJedi.SelectedItem as ViewModel.Jedi.JediViewModel).Jedi.Equals(winner))
                        {
                            BusinessLayer.PartieManager.getCurrentGame().Bourse_j1 += BusinessLayer.PartieManager.getCurrentGame().Pari_j1;
                        }
                        else
                        {
                            BusinessLayer.PartieManager.getCurrentGame().Bourse_j1 -= BusinessLayer.PartieManager.getCurrentGame().Pari_j1;
                        }
                    }

                    if (BusinessLayer.PartieManager.getCurrentGame().J2 != null &&
                        (this.J2Jedi.ComboJedi.SelectedItem as ViewModel.Jedi.JediViewModel) != null &&
                        BusinessLayer.PartieManager.getCurrentGame().Pari_j2 != 0)
                    {
                        if ((this.J2Jedi.ComboJedi.SelectedItem as ViewModel.Jedi.JediViewModel).Jedi.Equals(winner))
                        {
                            BusinessLayer.PartieManager.getCurrentGame().Bourse_j2 += BusinessLayer.PartieManager.getCurrentGame().Pari_j2;
                        }
                        else
                        {
                            BusinessLayer.PartieManager.getCurrentGame().Bourse_j2 -= BusinessLayer.PartieManager.getCurrentGame().Pari_j2;
                        }
                    }
                }
            }
        }
Example #3
0
 public JediViewModel(EntitiesLayer.Jedi jedi)
 {
     m_jedi = jedi;
 }
Example #4
0
 private void Add() 
 {
     EntitiesLayer.Jedi j = new EntitiesLayer.Jedi(0, new List<EntitiesLayer.Caracteristique>(), false, "New");   
     this.SelectedJedi = new JediViewModel(j);
     m_jedis.Add(this.SelectedJedi);
 }
 private void Add()
 {
     EntitiesLayer.Jedi j = new EntitiesLayer.Jedi(0, new List <EntitiesLayer.Caracteristique>(), false, "New");
     this.SelectedJedi = new JediViewModel(j);
     m_jedis.Add(this.SelectedJedi);
 }