From aa0b9ed3bfab16b6aed8dfb4eecfe9b926ea5b8f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Bergstr=C3=B6m?= <davbe125@student.liu.se>
Date: Mon, 25 Jun 2018 10:42:50 +0200
Subject: [PATCH] Remove parsing of BotConfig.txt

This is a nice feature, but it took too long to force CMAKE into
outputting the binary into the correct directory.
---
 src/main.cpp | 31 +++----------------------------
 1 file changed, 3 insertions(+), 28 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index b85ee9d02..19dee38f8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -15,38 +15,13 @@ int main(int argc, char* argv[])
         return 1;
     }
     
-    std::string config = JSONTools::ReadFile("BotConfig.txt");
-    if (config.length() == 0)
-    {
-        std::cerr << "Config file could not be found, and is required for starting the bot\n";
-        std::cerr << "Please read the instructions and try again\n";
-        exit(-1);
-    }
+    std::string botRaceString = "Terran";
+    std::string enemyRaceString = "Random";
+    std::string mapString = "InterloperTest.SC2MAP";
 
-    std::ifstream file("BotConfig.txt");
-    json j;
-    file >> j;
-
-    std::string botRaceString, enemyRaceString, mapString;
     int stepSize = 1;
     sc2::Difficulty enemyDifficulty = sc2::Difficulty::Easy;
 
-    if (j.count("SC2API") && j["SC2API"].is_object())
-    {
-        const json & info = j["SC2API"];
-        JSONTools::ReadString("BotRace", info, botRaceString);
-        JSONTools::ReadString("EnemyRace", info, enemyRaceString);
-        JSONTools::ReadString("MapFile", info, mapString);
-        JSONTools::ReadInt("StepSize", info, stepSize);
-        JSONTools::ReadInt("EnemyDifficulty", info, enemyDifficulty);
-    }
-    else
-    {
-        std::cerr << "Config file has no 'Game Info' object, required for starting the bot\n";
-        std::cerr << "Please read the instructions and try again\n";
-        exit(-1);
-    }
-
     // Add the custom bot, it will control the players.
     IDABot bot1;
     //IDABot bot2;
-- 
GitLab