public static bool SingleFight(BotFight botFight)
        {
            bool fightSuccess = false;
            try
            {
                if (isInit)
                {
                    //java -jar tools/PlayGame.jar maps/map43.txt 1000 1000 log.txt "java -jar example_bots/DualBot.jar" "bin/Debug/DefenderBot.exe" 1> stdout.txt 2> stderr.txt

                    FileInfo logPath = new FileInfo(applicationExecPath + "/logs/log_fight" + botFight.FightId().ToString() + ".txt");
                    botFight.Log(logPath);
                    FileInfo viewerInputPath = new FileInfo(applicationExecPath + "/viewer_inputs/input_fight" + botFight.FightId().ToString() + ".txt");
                    botFight.ViewerInput(viewerInputPath);
                    FileInfo resultPath = new FileInfo(applicationExecPath + "/results/result_fight" + botFight.FightId().ToString() + ".txt");
                    botFight.Result(resultPath);

                    //string[] execFileArgs = ExecFileArgsMaker(toolsPath, playGameFile, playGameCmd);
                    //string execFile = execFileArgs[0];
                    //string execArgs = execFileArgs[1];

                    /*string player1Cmd = (botFight.Player1().isJar())
                        ? ("\"java -jar \\\"" + botFight.Player1().BotFileInfo().FullName + "\\\"\"")
                        : ("\"" + botFight.Player1().BotFileInfo().FullName + "\"");
                    string player2Cmd = (botFight.Player2().isJar())
                        ? ("\"java -jar \\\"" + botFight.Player2().BotFileInfo().FullName + "\\\"\"")
                        : ("\"" + botFight.Player2().BotFileInfo().FullName + "\"");*/

                    string player1Cmd = PlayerCommand(botFight.Player1());
                    string player2Cmd = PlayerCommand(botFight.Player2());

                    /*string fightCmd = " -jar " + "\"" + playGamePath + "\" "
                        + "\"" + botFight.FightMap().MapFileInfo().FullName + "\" "
                        + botFight.TimeAmount().ToString() + " "
                        + botFight.TurnAmount().ToString() + " "
                        + "\"" + applicationPath + "/logs/log_fight" + botFight.FightId().ToString() + ".txt\" "
                        + player1Cmd + " "
                        + player2Cmd;/* +" "
                        + "1> \"" + applicationPath + "/viewer_inputs/input_fight" + botFight.FightId().ToString() + ".txt\" "
                        + "2> \"" + applicationPath + "/results/result_fight" + botFight.FightId().ToString() + ".txt\"";*/

                    //string fightCmd = " -jar" + " \"" + playGamePath + "\" "
                    string fightCmd = playGameExecArgs
                        + "\"" + botFight.FightMap().MapFileInfo().FullName + "\" "
                        + botFight.TimeAmount().ToString() + " "
                        + botFight.TurnAmount().ToString() + " "
                        + "\"" + botFight.Log().FullName + "\" "
                        + player1Cmd + " "
                        + player2Cmd;
                    //Process process = new Process();
                    //process.StartInfo.FileName = playGameExecFile;
                    //process.StartInfo.Arguments = fightCmd;
                    //process.StartInfo.UseShellExecute = false;
                    //process.StartInfo.CreateNoWindow = true;
                    //process.StartInfo.RedirectStandardOutput = true;
                    //process.StartInfo.RedirectStandardError = true;
                    //process.Start();
                    //string stdout = process.StandardOutput.ReadToEnd();
                    //string stderr = process.StandardError.ReadToEnd();
                    //process.WaitForExit();
                    botFight.Command(playGameExecFile + " " + fightCmd);
                    ProcessRunner pr = new ProcessRunner(playGameExecFile, fightCmd);
                    pr.ProcessWorker();
                    string stdout = pr.OutputString();
                    string stderr = pr.ErrorString();

                    StreamWriter streamWriter = new StreamWriter(botFight.ViewerInput().FullName);
                    streamWriter.WriteLine(stdout);
                    streamWriter.Close();

                    streamWriter = new StreamWriter(botFight.Result().FullName);
                    streamWriter.WriteLine(stderr);
                    streamWriter.Close();

                    fightSuccess = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return fightSuccess;
        }
        public static void ViewGame(BotFight botFight)
        {
            ///string viewGamePath = starterPackagePath + "/tools/ShowGame.jar";
            //string viewCmd = " -jar " + "\"" + viewGamePath + "\"";

            //string[] execFileArgs = ExecFileArgsMaker(toolsPath, showGameFile, showGameCmd);
            //string execFile = execFileArgs[0];
            //string execArgs = execFileArgs[1];

            if (isInit)
            {
                StreamReader streamReader = new StreamReader(botFight.ViewerInput().FullName);
                string viewerInput = streamReader.ReadToEnd();
                streamReader.Close();

                Process process = new Process();
                process.StartInfo.FileName = showGameExecFile;
                process.StartInfo.Arguments = showGameExecArgs;
                process.StartInfo.UseShellExecute = false;
                process.StartInfo.CreateNoWindow = true;
                process.StartInfo.RedirectStandardInput = true;
                process.Start();

                StreamWriter streamWriter = process.StandardInput;
                streamWriter.WriteLine(viewerInput);
                streamWriter.Close();

                process.WaitForExit();
            }
        }