private string RenderRow(LeagueRow row, int rowIndex, int totalRows) { string rowBoundary = string.Join(" ", Enumerable.Repeat(Boundary, row.GetMaxSize())); var formattedNames = row.GetPlayers().Select(name => $"|{FormatName(name)}|").ToList(); int rowsRemaining = totalRows - rowIndex; int paddingLength = (BoxWidth + 1) / 2 * rowsRemaining; string padding = new string(' ', paddingLength); var emptyNames = Enumerable.Repeat(EmptyName, row.GetMaxSize() - formattedNames.Count); var allNames = string.Join(" ", formattedNames.Concat(emptyNames)); return($"{padding}{rowBoundary}\r\n{padding}{allNames}\r\n{padding}{rowBoundary}"); }
private string serialiseRow(LeagueRow row) { return(string.Join(",", row.GetPlayers())); }