コード例 #1
0
        public BettingManager(BusinessManager businessManager, int nbJoueur)
        {
            this.businessManager = businessManager;
            rand    = new Random();
            joueurs = new List <Joueur>();

            for (int i = 0; i < nbJoueur; i++)
            {
                joueurs.Add(new Joueur("player" + i, 0));
            }

            List <Jedi> allJedis      = businessManager.getJedis();
            List <Jedi> jedis_to_pool = new List <Jedi>();


            //Creation de la liste a mettre dans la pool
            for (int i = 0; i < 16; i++)
            {
                int index = rand.Next() % allJedis.Count;
                jedis_to_pool.Add(allJedis[index]);
                allJedis.Remove(allJedis[index]);
            }

            jedis = jedis_to_pool;
            pool  = new Tournoi(jedis_to_pool, businessManager.getStades());
        }
コード例 #2
0
        public BettingManager(BusinessManager businessManager, int nbJoueur)
        {
            this.businessManager = businessManager;
            rand = new Random();
            joueurs = new List<Joueur>();

            for (int i = 0; i < nbJoueur; i++)
            {
                joueurs.Add(new Joueur("player" + i, 0));
            }

            List<Jedi> allJedis = businessManager.getJedis();
            List<Jedi> jedis_to_pool = new List<Jedi>();

            //Creation de la liste a mettre dans la pool
            for (int i = 0; i < 16; i++)
            {
                int index = rand.Next() % allJedis.Count;
                jedis_to_pool.Add(allJedis[index]);
                allJedis.Remove(allJedis[index]);
            }

            jedis = jedis_to_pool;
            pool = new Tournoi(jedis_to_pool, businessManager.getStades());
        }
コード例 #3
0
        public void LancerMatch(Jedi jedi, int nbJediDepart)
        {
            end        = false;
            win        = false;
            playerJedi = jedi;

            List <Jedi> jedis        = businessManager.getJedis();
            Jedi        jediToRemove = jedis.Find(x => x.Id == jedi.Id);

            jedis.Remove(jediToRemove);
            List <Jedi> jedis_to_pool = new List <Jedi>();

            jedis_to_pool.Add(jedi);

            Random rand = new Random();

            //Creation de la liste a mettre dans la pool
            for (int i = 0; i < nbJediDepart - 1; i++)
            {
                int index = rand.Next() % jedis.Count;
                jedis_to_pool.Add(jedis[index]);
                jedis.Remove(jedis[index]);
            }

            //Premiere pool a jouer
            //Le premier match de la list sera celui du joueur
            pool = new Tournoi(jedis_to_pool, businessManager.getStades());

            //On joue tout les autres matches
            foreach (Match match in pool.Matches)
            {
                PlayingMatch pMatch = new PlayingMatch(match);
                while (!pMatch.MatchOver)
                {
                    pMatch.playTurn(pMatch.automaticChoose(), pMatch.automaticChoose());
                }
            }
            pool.Matches[0].JediVainqueur = null;
            playerPlayingMatch            = new PlayingMatch(pool.Matches[0]);
        }
コード例 #4
0
        public BettingManager(BusinessManager businessManager)
        {
            this.businessManager = businessManager;
            rand = new Random();

            joueur1 = new Joueur("player1", 0);
            joueur2 = new Joueur("player2", 0);

            List <Jedi> allJedis      = businessManager.getJedis();
            List <Jedi> jedis_to_pool = new List <Jedi>();


            //Creation de la liste a mettre dans la pool
            for (int i = 0; i < 16; i++)
            {
                int index = rand.Next() % allJedis.Count;
                jedis_to_pool.Add(allJedis[index]);
                allJedis.Remove(allJedis[index]);
            }

            jedis = jedis_to_pool;
            pool  = new Pool(jedis_to_pool, businessManager.getStades());
        }
コード例 #5
0
        public BettingManager(BusinessManager businessManager)
        {
            this.businessManager = businessManager;
            rand = new Random();

            joueur1 = new Joueur("player1", 0);
            joueur2 = new Joueur("player2", 0);

            List<Jedi> allJedis = businessManager.getJedis();
            List<Jedi> jedis_to_pool = new List<Jedi>();


            //Creation de la liste a mettre dans la pool
            for (int i = 0; i < 16; i++)
            {
                int index = rand.Next() % allJedis.Count;
                jedis_to_pool.Add(allJedis[index]);
                allJedis.Remove(allJedis[index]);
            }

            jedis = jedis_to_pool;
            pool = new Pool(jedis_to_pool, businessManager.getStades());

        }