Example #1
0
        //Single pixel paint
        public bool Paint(Vector2Int pos, CellType c, EPaintType paintType = EPaintType.PAINT_NEXT)
        {
            if (pos.X < 0 || pos.X >= TableSize.X || pos.Y < 0 || pos.Y >= TableSize.Y)
            {
                return(false);
            }

            CellType prev   = CurrentTable.Cells[pos.X, pos.Y].CellType;
            bool     result = false;

            switch (paintType)
            {
            case EPaintType.PAINT_NEXT:
                result = NextIterationTable.PlaceCell(pos, c);
                break;

            case EPaintType.PAINT_CURRENT:
                result = CurrentTable.PlaceCell(pos, c);
                break;
            }

            if (result && prev != c)
            {
                Delta.Add(pos);
            }
            return(result);
        }