Exemplo n.º 1
0
        public void AddIsland(DestroyableLogFloodfill.Island island)
        {
            for (var i = island.Lines.Count - 1; i >= 0; i--)
            {
                var line = island.Lines[i];

                for (var j = line.MinX; j < line.MaxX; j++)
                {
                    AddPixel(j, line.Y);
                }
            }
        }
        public void Transform(DestroyableRect newRect, DestroyableLogFloodfill.Island island)
        {
            Clear();
            Prepare(newRect, true);

            for (var i = island.Lines.Count - 1; i >= 0; i--)
            {
                var line = island.Lines[i];

                for (var x = line.MinX; x < line.MaxX; x++)
                {
                    Cells[x - newRect.MinX + (line.Y - newRect.MinY) * newRect.SizeX] = new Cell(0, 0, 0);
                }
            }

            Transform();
        }