using System.Collections.Generic;
using System.Linq;
using CrossCutting;

namespace InterpreterLibrary.Processing
{

        class BlobEx : Blob
        {
            public BlobEx(Blob source, IEnumerable<Point> polygon) : base(source)
            {
                var lst = new List<Point>(polygon);
                if (lst.First().X != lst.Last().X
                    || lst.First().Y != lst.Last().Y)
                {
                    lst.Add(lst.First());
                }
                Polygon = lst.ToArray();
            }

            public Point[] Polygon { get; }
        }
}

