Esempio n. 1
0
        public void lancerPhaseTournoi(List <int> paris, List <Jedi> jedis_paris)
        {
            foreach (Match match in pool.Matches)
            {
                PlayingMatch pMatch = new PlayingMatch(match);
                while (!pMatch.MatchOver)
                {
                    pMatch.playTurn(pMatch.automaticChoose(), pMatch.automaticChoose());
                }
                for (int i = 0; i < joueurs.Count; i++)
                {
                    if (match.JediVainqueur.Id == jedis_paris[i].Id)
                    {
                        joueurs[i].Score += paris[i];
                    }
                }
            }

            //Maj bdd
            List <Match> oldMatches = businessManager.getMatches();

            oldMatches.Concat(pool.Matches);
            businessManager.updateMatch(oldMatches);
            pool  = pool.nextPool();
            jedis = new List <Jedi>();
            foreach (Match match in pool.Matches)
            {
                jedis.Add(match.Jedi1);
                jedis.Add(match.Jedi2);
            }
            end = pool.PoolVide;
        }
        public void lancerPhaseTournoi(int parisJoueur1, Jedi jediParisJoueur1, int parisJoueur2, Jedi jediParisJoueur2)
        {
            foreach (Match match in pool.Matches)
            {
                PlayingMatch pMatch = new PlayingMatch(match);
                while (!pMatch.MatchOver)
                {
                    pMatch.playTurn(pMatch.automaticChoose(), pMatch.automaticChoose());
                }
                if (match.JediVainqueur.Id == jediParisJoueur1.Id)
                {
                    joueur1.Score += parisJoueur1;
                }
                if (match.JediVainqueur.Id == jediParisJoueur2.Id)
                {
                    joueur2.Score += parisJoueur2;
                }
            }

            //Maj bdd
            List <Match> oldMatches = businessManager.getMatches();

            oldMatches.Concat(pool.Matches);
            businessManager.updateMatch(oldMatches);
            pool  = pool.nextPool();
            jedis = new List <Jedi>();
            foreach (Match match in pool.Matches)
            {
                jedis.Add(match.Jedi1);
                jedis.Add(match.Jedi2);
            }
            end = pool.PoolVide;
        }
Esempio n. 3
0
 private void checkContinue()
 {
     statLastTurn = turn();
     if (playerPlayingMatch.MatchOver)
     {
         if (playerPlayingMatch.Match.JediVainqueur.Id != playerJedi.Id)
         {
             //player loose
             end = true;
             win = false;
         }
         else
         {
             //Maj bdd
             List <Match> oldMatches = businessManager.getMatches();
             oldMatches.Concat(pool.Matches);
             businessManager.updateMatch(oldMatches);
             pool = pool.nextPool();
             foreach (Match match in pool.Matches)
             {
                 PlayingMatch pMatch = new PlayingMatch(match);
                 while (!pMatch.MatchOver)
                 {
                     pMatch.playTurn(pMatch.automaticChoose(), pMatch.automaticChoose());
                 }
             }
             if (pool.PoolVide)
             {
                 end = true;
                 win = true;
             }
             else
             {
                 pool.Matches[0].JediVainqueur = null;
                 playerPlayingMatch            = new PlayingMatch(pool.Matches[0]);
             }
         }
     }
 }