Пример #1
0
        public void Clean(GameObjectsSet gOS)
        {
            Action <List <CellData> > cAction = (arr) =>
            {
                if (arr != null)
                {
                    arr.RemoveAll((c) =>
                    {
                        return(!BubbleGrid.ok(c.Row, c.Column, vertSize, horSize));
                    });

                    if (gOS)
                    {
                        arr.RemoveAll((c) =>
                        {
                            return(!gOS.ContainID(c.ID));
                        });
                    }
                }
            };

            cAction(featuredCells);
            cAction(overlays);
            SetAsDirty();
        }
Пример #2
0
        /// <summary>
        /// Remove all non-existent cells data from board
        /// </summary>
        /// <param name="gOS"></param>
        public void Clean(GameObjectsSet gOS)
        {
            Action <List <CellData> > cAction = (arr) =>
            {
                if (arr != null)
                {
                    arr.RemoveAll((c) =>
                    {
                        return((c.Column >= horSize) && (c.Row >= vertSize));
                    });

                    if (gOS)
                    {
                        arr.RemoveAll((c) =>
                        {
                            return(!gOS.ContainID(c.ID));
                        });
                    }
                }
            };

            cAction(featuredCells);
            cAction(blockedCells);
            cAction(overlayCells);
            cAction(disabledCells);
            cAction(underlayCells);
            cAction(dynamicBlockerCells);
            cAction(staticBlockerCells);
            if (matchObjects != null)
            {
                matchObjects.RemoveAll((m) => { return(!gOS.ContainMatchID(m)); });
            }
            SetAsDirty();
        }