< Summary

Information
Class: BallSort.Engine.Extensions.BoardExtensions
Assembly: BallSort.Engine
File(s): /home/runner/work/BallSort/BallSort/src/BallSort.Engine/Extensions/BoardExtensions.cs
Tag: 216
Line coverage
0%
Covered lines: 0
Uncovered lines: 13
Coverable lines: 13
Total lines: 43
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 8
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Dump(...)0%7280%

File(s)

/home/runner/work/BallSort/BallSort/src/BallSort.Engine/Extensions/BoardExtensions.cs

#LineLine coverage
 1using System.Text;
 2using BallSort.Engine.Game;
 3
 4namespace BallSort.Engine.Extensions;
 5
 6public static class BoardExtensions
 7{
 8    extension(Board board)
 9    {
 10        public void Dump()
 11        {
 012            var builder = new StringBuilder();
 13
 014            var columns = new List<Colour[]>();
 15
 016            for (var x = 0; x < board.Width; x++)
 17            {
 018                columns.Add(board.GetColumn(x).ToArray());
 19            }
 20
 021            for (var y = board.Height - 1; y >= 0; y--)
 22            {
 023                for (var x = 0; x < board.Width; x++)
 24                {
 025                    var ball = columns[x][y];
 26
 027                    if (ball == Colour.Empty)
 28                    {
 029                        builder.Append('-');
 30                    }
 31                    else
 32                    {
 033                        builder.Append((char) ('@' + (int) columns[x][y]));
 34                    }
 35                }
 36
 037                Console.WriteLine($"  {builder}");
 38
 039                builder.Clear();
 40            }
 041        }
 42    }
 43}