예제 #1
0
        void SetupBoardVisual()
        {
            if (firsttime)
            {
                if (height <= 32 && width <= 32)
                {
                    form.textSize = 14f;
                }

                else if (height <= 48 && width <= 48)
                {
                    form.textSize = 10f;
                }

                else if (height <= 64 && width <= 64)
                {
                    form.textSize = 6f;
                }

                else
                {
                    form.textSize = 4f;
                }

                int formHeight = (int)(PixelLayout.FontPointToPixel((int)form.textSize) * 1.25 * height);
                int formWidth  = (int)(PixelLayout.FontPointToPixel((int)form.textSize) * 0.75 * width);

                form.CalculateBoardWindowSize(formHeight, formWidth);
                firsttime = false;
            }

            string s = "";

            for (int y = 0; y < currentBoard.GetLength(1); y++)
            {
                for (int x = 0; x < currentBoard.GetLength(0); x++)
                {
                    s += currentBoard[x, y].ToString();
                }

                //if (y < currentBoard.GetLength(1) - 1)
                s += Environment.NewLine;
            }

            form.SetText(s);
        }