Example #1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            List <IGH_Goo> data = new List <IGH_Goo>();
            bool           wrap = false;

            if (!DA.GetDataList(0, data))
            {
                return;
            }
            DA.GetData(1, ref wrap);


            List <IGH_Goo> Fw, Bw;

            Fw = data.ConvertAll(d => d);
            Bw = data.ConvertAll(d => d);

            Fw.RemoveAt(Fw.Count - 1);
            Bw.RemoveAt(0);

            if (wrap)
            {
                IGH_Goo first, last;
                first = data[0];
                last  = data[data.Count - 1];

                Fw.Insert(0, last);
                Bw.Add(first);
            }


            DA.SetDataList(0, Fw);
            DA.SetDataList(1, Bw);
        }