Exemplo n.º 1
0
        public Forme InitialiserForme()
        {
            #region Les formes

            Forme carre         = new Carree();
            Forme l             = new L();
            Forme linverse      = new LInverse();
            Forme ligne         = new Ligne();
            Forme marche        = new Marche();
            Forme marcheInverse = new MarcheInverse();
            Forme t             = new T();



            formes.Clear();
            Forme formeAleatoire;
            formes.Add(carre);
            formes.Add(l);
            formes.Add(linverse);
            formes.Add(ligne);
            formes.Add(marche);
            formes.Add(marcheInverse);
            formes.Add(t);
            #endregion

            Random geneAleatoire = new Random();
            int    nombregenere  = geneAleatoire.Next(0, formes.Count);
            int    couleurgenere = geneAleatoire.Next(0, ListeCouleur.Count);
            formeAleatoire         = formes[nombregenere];
            formeAleatoire.Couleur = ListeCouleur[couleurgenere];
            return(formeAleatoire);
        }
Exemplo n.º 2
0
        public override Forme ShallowCopy()
        {
            Forme marche = new Marche();

            marche.blocs = this.blocs;;
            return(marche);
        }
Exemplo n.º 3
0
 public override Forme ShallowCopy()
 {
     Forme marche = new Marche();
     marche.blocs   = this.blocs; ;
     return marche;
 }