Exemplo n.º 1
0
        // public methods
        public void ShowResult()
        {
            if (Results.Count == 0)
            {
                MessageBox.Show("Brak wyników");
                return;
            }

            var form = new ChessBoardForm(Results, _chessBoardSize, LastActionTime);

            form.Show();
        }
        /// <summary>
        /// Builds image for game state
        /// </summary>
        /// <param name="gameState">FEN Value of the current game state</param>
        /// <param name="playerCurrentTurn">Name for the player who's turn it now is</param>
        /// <param name="playerNowWaiting">Name for player who just went</param>
        /// <returns>asset path for the new image</returns>
        public static string processImage(string gameState, string playerCurrentTurn, string playerNowWaiting)
        {
            // Setup Objects
            ChessBoardForm cbbForm = new ChessBoardForm();
            ChessBoardImageGenerator cbbImgGen = new ChessBoardImageGenerator(cbbForm);
            cbbForm.ImageGenerator = cbbImgGen;

            // Setup Output Fields
            cbbImgGen.FileNameImageFormat = ImageFormat.Png;
            cbbImgGen.ImageFileName = @"..\..\DigitalAssets\GameBoardImage.png";

            // Setup Input Fields
            if (playerCurrentTurn.Length > 0)
            {
                cbbImgGen.WhitePlayerButtonText = playerCurrentTurn;
            }
            else
            {
                cbbImgGen.WhitePlayerButtonText = "Current Player";
            }
            if (playerNowWaiting.Length > 0)
            {
                cbbImgGen.BlackPlayerButtonText = playerNowWaiting;
            }
            else
            {
                cbbImgGen.BlackPlayerButtonText = "Waiting Player";
            }

            cbbForm.ChessBoardStateFEN = gameState;

            Application.Run(cbbForm);
            Application.Exit();

            return cbbImgGen.ImageFileName;
        }
        public void ShowResult()
        {
            var form = new ChessBoardForm(Result, _chessBoardSize, LastActionTime);

            form.Show();
        }
        public void ShowResult()
        {
            var form = new ChessBoardForm(_positionInColums, _chessBoardSize, LastActionTime);

            form.Show();
        }