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(); }
/// <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(); }