Пример #1
0
        private void InitActeurs(int[] parametres)
        {
            int nbIsimons = (int)Math.Ceiling((double)parametres[0] * parametres[1] * parametres[3] / 100);
            int nbArbres = (int)Math.Ceiling((double)parametres[0] * parametres[1] * parametres[2] / 100);
            int nbDresseurs = (int)Math.Ceiling((double)parametres[0] * parametres[1] * parametres[4] / 100);

            for (int i = 0; i < nbArbres; i++)
            {
                int row = PseudoAlea.GetInt(0, _nbRow-1);
                int col = PseudoAlea.GetInt(0, _nbColumn-1);
                while (! _matrice[row, col].IsEmpty())
                {
                    row = PseudoAlea.GetInt(0, _nbRow-1);
                    col = PseudoAlea.GetInt(0, _nbColumn-1);
                }
                Entite a = new Entite("Arbre", "Arbre.png");
                AddActeur(a);
                DeplacerActeur(a, _matrice[row, col]);
            }

            for (int i = 0; i < nbIsimons; i++)
            {
                int row = PseudoAlea.GetInt(0, _nbRow-1);
                int col = PseudoAlea.GetInt(0, _nbColumn-1);
                while (!_matrice[row, col].IsEmpty())
                {
                    row = PseudoAlea.GetInt(0, _nbRow-1);
                    col = PseudoAlea.GetInt(0, _nbColumn-1);
                }
                Isimon a = new Isimon(IsimonsDispos.Instance.getRandomProfil(),this);
                AddActeur(a);
                DeplacerActeur(a, _matrice[row, col]);
            }

            for (int i = 0; i < nbDresseurs; i++)
            {
                int row = PseudoAlea.GetInt(0, _nbRow-1);
                int col = PseudoAlea.GetInt(0, _nbColumn-1);
                while (!_matrice[row, col].IsEmpty())
                {
                    row = PseudoAlea.GetInt(0, _nbRow-1);
                    col = PseudoAlea.GetInt(0, _nbColumn-1);
                }
                Dresseur a = new Dresseur("Dresseur", "Sacha.png",this);
                AddActeur(a);
                DeplacerActeur(a, _matrice[row, col]);
            }
        }
Пример #2
0
 private bool LancerCombat(Dresseur d)
 {
     return true;
 }