private void RenderRow(bool[] row) { ConsoleColor originalBackground = Console.BackgroundColor; int rowIndex = row.Length - 1; Write(String.Format("{0,2} ", rowIndex + 1), ConsoleColor.White); RowRenderData rowData = boardRenderData.Rows[rowIndex]; rowData.CursorTop = Console.CursorTop; for (int iPin = 0; iPin < row.Length; iPin++) { PinRenderData pinData = rowData.Pins[iPin]; pinData.Available = row[iPin]; pinData.CursorLeft = Console.CursorLeft; RenderPin(pinData); Write(" ", Console.ForegroundColor); } Console.BackgroundColor = originalBackground; }
private void RenderPinUpdate(PinRenderData pinData) { int left = Console.CursorLeft; int top = Console.CursorTop; Console.CursorLeft = pinData.CursorLeft; Console.CursorTop = pinData.Row.CursorTop; Write("|", pinData.Color); Console.CursorLeft = left; Console.CursorTop = top; }
public void SelectPins(int rowIndex, int firstPinIndex, int length) { boardRenderData.SelectedMove.FirstPin = firstPinIndex; RowRenderData rowData = boardRenderData.Rows[rowIndex]; for (int i = firstPinIndex; i < firstPinIndex + length; i++) { PinRenderData pinData = rowData.Pins[i]; pinData.Selected = true; RenderPinUpdate(pinData); } }
private void RenderPin(PinRenderData pinData) { pinData.CursorLeft = Console.CursorLeft; Write("|", pinData.Color); }