예제 #1
0
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
 private void RenderPin(PinRenderData pinData)
 {
     pinData.CursorLeft = Console.CursorLeft;
     Write("|", pinData.Color);
 }