Esempio n. 1
0
 public Pole(int size, int seed)
 {
     path        = new PolePath();
     myRandGen   = new MyRandom(seed);
     poleSize    = size;
     eltsManager = new PoleElts();
     poleDots    = new PoleDot[size][];
     poleLines   = new List <PoleLine>();
     for (int y = 0; y < size; y++)
     {
         poleDots[y] = new PoleDot[size];
         for (int x = 0; x < size; x++)
         {
             poleDots[y][x] = new PoleDot(x, y);
         }
     }
     for (int y = 0; y < size; y++)
     {
         for (int x = 0; x < size - 1; x++)
         {
             PoleLine line = new PoleLine(poleDots[y][x], poleDots[y][x + 1]);
             poleDots[y][x].AddLine(line, poleDots[y][x + 1]);
             poleDots[y][x + 1].AddLine(line, poleDots[y][x]);
             poleLines.Add(line);
         }
         if (y < size - 1)
         {
             for (int x = 0; x < size; x++)
             {
                 PoleLine line = new PoleLine(poleDots[y][x], poleDots[y + 1][x]);
                 poleDots[y][x].AddLine(line, poleDots[y + 1][x]);
                 poleDots[y + 1][x].AddLine(line, poleDots[y][x]);
                 poleLines.Add(line);
             }
         }
     }
 }
Esempio n. 2
0
 public void SetNewSeed(int k)
 {
     myRandGen = new MyRandom(k);
 }