Beispiel #1
0
        public override Forme ShallowCopy()
        {
            Forme carre = new Carree();

            carre.blocs = this.blocs;
            return(carre);
        }
Beispiel #2
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);
        }
Beispiel #3
0
 public override Forme ShallowCopy()
 {
     Forme carre = new Carree();
     carre.blocs = this.blocs;
     return carre;
 }