예제 #1
0
        public void RenderPart(int[] coordinates)
        {
            for (int i = 0; i < coordinates.Length; i += 2)
            {
                if (coordinates[i] > 1)
                {
                    Console.BackgroundColor = Block.GetCorrespondingColorForType(this.BoardMatrix[coordinates[i], coordinates[i + 1]]);
                    for (int k = 0; k < BlockHeight; k++)
                    {
                        Console.SetCursorPosition(StartCol + coordinates[i + 1] * BlockWidth, StartRow + k + (coordinates[i] - HiddenRows) * BlockHeight);
                        Console.Write(new string(' ', BlockWidth));
                    }
                }
            }

            Console.BackgroundColor = ConsoleColor.Black;
        }
예제 #2
0
        public void Render()
        {
            Console.SetCursorPosition(StartCol, StartRow);
            for (int i = HiddenRows; i < HiddenRows + Rows; i++)
            {
                for (int j = 0; j < Cols; j++)
                {
                    Console.BackgroundColor = Block.GetCorrespondingColorForType(this.BoardMatrix[i, j]);
                    for (int k = 0; k < BlockHeight; k++)
                    {
                        Console.SetCursorPosition(StartCol + j * BlockWidth, StartRow + k + (i - HiddenRows) * BlockHeight);
                        Console.Write(new string(' ', BlockWidth));
                    }
                }
            }

            Console.BackgroundColor = ConsoleColor.Black;
        }