Пример #1
0
        /// <summary>
        /// Ajoute un nouveau match à la liste de matchs.
        /// </summary>
        private void New()
        {
            Match m = new Match(_newNextId--, null, null, EPhaseTournoi.QuartFinale, null);

            this.SelectedItem = new MatchViewModel(m);
            Matchs.Add(this.SelectedItem);
        }
Пример #2
0
 public void MatchStart(int i)
 {
     if (Matchs[i].IdPokemonVainqueur == -1)
     {
         Matchs[i].MatchStart();
         try
         {
             if (i % 2 == 0)
             {
                 if (Matchs[i + 1].IdPokemonVainqueur != -1)
                 {
                     Pokemon p1 = Matchs[i].getPokemonVainqueur();
                     Pokemon p2 = Matchs[i + 1].getPokemonVainqueur();
                     Matchs.Add(new Match(p1, p2, Matchs[i].Phase_next()));
                     nbrMatch++;
                 }
             }
             else if (i % 2 == 1)
             {
                 if (Matchs[i - 1].IdPokemonVainqueur != -1)
                 {
                     Pokemon p1 = Matchs[i].getPokemonVainqueur();
                     Pokemon p2 = Matchs[i - 1].getPokemonVainqueur();
                     Matchs.Add(new Match(p2, p1, Matchs[i].Phase_next()));
                     nbrMatch++;
                 }
             }
         }
         catch { }
     }
 }
        private void Add()
        {
            JediTournamentEntities.Match a = new JediTournamentEntities.Match();

            this.SelectedItem = new GestionMatchsViewModel(a);
            Matchs.Add(this.SelectedItem);
        }
Пример #4
0
 public void AjouterMatch(Match match)
 {
     //   if (Matchs.Count < 8)
     //   {
     Matchs.Add(match);
     nbrMatch++;
     //   }
 }
Пример #5
0
 private Pokemon[] JouerPhaseTournoi(Pokemon[] tablpokemon, EPhaseTournoi phase)
 {
     Pokemon[] pokevainqueur = new Pokemon[(int)((tablpokemon.Length) / 2)];
     for (int i = 0; i < (tablpokemon.Length) / 2; i++)
     {
         Stade stade = getRandomStade();
         Match match = new Match(tablpokemon[i * 2], tablpokemon[(i * 2) + 1], stade, phase);
         match.JouerMatch();
         Matchs.Add(match);
         pokevainqueur[i] = match.Vainqueur;
     }
     return(pokevainqueur);
 }