private void J1Jedi_MouseEnter(object sender, MouseEventArgs e) { EntitiesLayer.Partie game = BusinessLayer.PartieManager.getCurrentGame(); if (game.Tournament != null && (this.J1Jedi.ComboJedi.SelectedItem as ViewModel.Jedi.JediViewModel) == null) { BusinessLayer.JediTournamentManager jtm = new BusinessLayer.JediTournamentManager(); List <EntitiesLayer.Jedi> jedis = new List <EntitiesLayer.Jedi>(); foreach (EntitiesLayer.Match m in game.Tournament.Matchs) { if (m.Jedi1 != null) { jedis.Add(m.Jedi1); } if (m.Jedi2 != null) { jedis.Add(m.Jedi2); } } IList <EntitiesLayer.Jedi> jedis2 = jedis; ViewModel.Jedi.JedisModelView jvm = new ViewModel.Jedi.JedisModelView(jedis); J1Jedi.DataContext = jvm; //jvm.Jedis.First(); } }
private void WindowLoaded(object sender, EventArgs args) { BusinessLayer.JediTournamentManager jtm = new BusinessLayer.JediTournamentManager(); fightPage.DataContext = BusinessLayer.PartieManager.getCurrentGame().Current_match.Stade; // Gestion de la Partie EntitiesLayer.Partie game = BusinessLayer.PartieManager.getCurrentGame(); ViewModel.Partie.PartieViewModel gvm = new ViewModel.Partie.PartieViewModel(game); Concurent1.DataContext = gvm.Current_match.Jedi1; Concurent2.DataContext = gvm.Current_match.Jedi2; Pari1.DataContext = gvm; Pari2.DataContext = gvm; game.Choice_j1 = EntitiesLayer.EShifumi.Aucun; game.Choice_j2 = EntitiesLayer.EShifumi.Aucun; game.Pari_j1 = 0; game.Pari_j2 = 0; PhaseTournoi.Text = gvm.Current_match.PhaseTournoi.ToString(); Affiche1.Visibility = Visibility.Hidden; Affiche2.Visibility = Visibility.Hidden; if (BusinessLayer.PartieManager.getCurrentGame().Mode == EntitiesLayer.Mode.SoloPari || BusinessLayer.PartieManager.getCurrentGame().Mode == EntitiesLayer.Mode.MultiPari) { List <EntitiesLayer.Jedi> jedis = new List <EntitiesLayer.Jedi>(); jedis.Add(game.Current_match.Jedi1); jedis.Add(game.Current_match.Jedi2); IList <EntitiesLayer.Jedi> jedis2 = jedis; ViewModel.Jedi.JedisModelView jvm = new ViewModel.Jedi.JedisModelView(jedis); J1Jedi.DataContext = jvm; ViewModel.Jedi.JedisModelView jvm2 = new ViewModel.Jedi.JedisModelView(jedis); J2Jedi.DataContext = jvm2; if (BusinessLayer.PartieManager.getCurrentGame().J1 != null) { Pari1.Visibility = Visibility.Visible; } if (BusinessLayer.PartieManager.getCurrentGame().J2 != null) { Pari2.Visibility = Visibility.Visible; } } var window = Window.GetWindow(this); window.KeyDown += Page_KeyDown; }
public PartieViewModel(EntitiesLayer.Partie partie) { m_partie = partie; }
public static void startNewGame() { jtm = new BusinessLayer.JediTournamentManager(); game = new EntitiesLayer.Partie(); rd = new Random((int)DateTime.Now.Ticks & 0x0000FFFF); }