Beispiel #1
0
        internal void AddPolygonClone(JobInfo info)
        {
            if (Polygons.Count < info.Settings.PolygonsMax)
            {
                if (Polygons.Count < 1)
                {
                    AddPolygon(info);
                }
                else
                {
                    DnaPolygon parent     = Polygons[info.GetRandomNumber(0, Polygons.Count)];
                    DnaPolygon newPolygon = parent.Clone();
                    Polygons.Insert(Polygons.IndexOf(parent), newPolygon);

                    newPolygon.Offset(info.GetRandomNumber(-6, 6), info.GetRandomNumber(-6, 6));

                    SetDirty();
                }
            }
        }
Beispiel #2
0
 public int IndexOf(Polygon p)
 {
     return(Polygons.IndexOf(p));
 }