Example #1
0
 private void ApplyColors(GridBlockInfo[] models, BlockItem[] blocks)
 => models.SlinqWithIndex()
 .ForEach(modelAndIndex =>
 {
     var color = BlockColorPalette.GetColor(modelAndIndex.Item1.Color);
     blocks[modelAndIndex.Item2].SetColor(modelAndIndex.Item1.Color, color);
 });
Example #2
0
        private void FillWithRandomColor(BlockItem[] blocks)
        {
            var colorAndName = BlockColorPalette.GetRandomNameAndColor();

            blocks.Slinq().ForEach(colorAndName, (block, _colorAndName) =>
                                   block.SetColor(_colorAndName.Item1, _colorAndName.Item2));
        }