Ejemplo n.º 1
0
 public void DeplacerActeur(Entite inI, Case inC)
 {
     if (inI.MyCase != null)
         inI.MyCase.Empty();
     inI.MyCase = inC;
     _matrice[inC.Row, inC.Column].Acteur=inI;
 }
Ejemplo n.º 2
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]);
            }
        }
Ejemplo n.º 3
0
 public void AddActeur(Entite inI)
 {
     _acteurs.Add(inI);
     _gPlateau.Children.Add(inI.Image);
 }
Ejemplo n.º 4
0
Archivo: Case.cs Proyecto: Thino/Simu
 public void Empty()
 {
     _acteur = null;
 }