public IEnumerable <GemBehaviour> CollapseColumns(IEnumerable <GemBehaviour> gems) { var movingGems = new List <GemBehaviour>(); var columns = BoardUtils.GetColumns(gems); foreach (var column in columns) { movingGems.AddRange( CollapseColumn(column) ); } return(movingGems); }
public GemBehaviour GetGem(GridIndex index) { return(BoardUtils.IsInBounds(index, columns, rows) ? allGems[index.GridX, index.GridY] : null); }