private static void RenderToConsole(UniversalGrid <char> grid) { Console.Clear(); Console.WriteLine(); var r = -1; grid.Render((p, m) => { if (p.Y > r) { //if(r > -1) Console.Write("|"); Console.WriteLine(); Console.Write(p.Y.ToString().PadRight(3)); Console.Write("|"); } if (m.Any()) { Console.Write("O"); } else { Console.Write(" "); } Console.Write("|"); r = p.Y; }); Console.WriteLine(); }
public void Write(UniversalGrid <T> grid) { var r = grid.TopLeft.Y - 1; var c = -1; _textFormatter.WriteStartGrid(grid); grid.Render((p, x) => { if (p.Y > r) { if (r > -1) { _textFormatter.WriteEndRow(); } _textFormatter.WriteStartRow(p.Y - grid.TopLeft.Y); c = 0; } _textFormatter.WriteCell(p, c, x); c++; r = p.Y; }); if (r > -1) { _textFormatter.WriteEndRow(); } _textFormatter.WriteEndGrid(); }
private int RenderToConsole(UniversalGrid <int> grid) { Console.WriteLine(); int c = 0; var r = -1; grid.Render((p, m) => { c++; if (p.Y > r) { Console.WriteLine(); Console.Write(p.Y + "\t"); } Console.Write("|\t"); if (m.Any()) { foreach (var i in m) { Console.Write(i.Label); } } Console.Write("\t"); r = p.Y; }); Console.WriteLine(); return(c); }