<commit_before>#include "GameCtrl.h"
#include "util/util.h"
#include <stdexcept>
#include <cstdio>
#include <chrono>
#include <cstdlib>
#ifdef _WIN32
#include <Windows.h>
#endif

using std::string;
using std::list;

// Error statements
const string GameCtrl::MSG_BAD_ALLOC = "Not enough memory to run the game.";
const string GameCtrl::MSG_LOSE = "Oops! You lose!";
const string GameCtrl::MSG_WIN = "Congratulations! You Win!";
const string GameCtrl::MSG_ESC = "Game ended.";
const string GameCtrl::MAP_INFO_FILENAME = "movements.txt";
int select_path=0; //Select Min Path or Max Path

GameCtrl::GameCtrl() {}

// class Destroyer
GameCtrl::~GameCtrl() {
    delete map;
    map = nullptr;
    if (movementFile) {
        fclose(movementFile);
        movementFile = nullptr;
    }
}

// Return the class instance's address
// Return instance will be used for creating and running game in main function
GameCtrl* GameCtrl::getInstance() {
=======
GameCtrl* GameCtrl::getInstance(int n) {

    static GameCtrl instance;
	select_path=n;
    return &instance;
}

void GameCtrl::setFPS(const double fps_) {
    fps = fps_;
}


// set program enable AI based search to decide next point to visit
// enableAI_(parameter) is boolean type whether the program use AI based search or not
void GameCtrl::setEnableAI(const bool enableAI_) {
    enableAI = enableAI_;
}


// set program enable Hamilton search to decide next point to visit
// enableHamilton_(parameter) is boolean type whether the program use Hamilton based search or not<commit_msg>Remove duplicate areas<commit_after>#include "GameCtrl.h"
#include "util/util.h"
#include <stdexcept>
#include <cstdio>
#include <chrono>
#include <cstdlib>
#ifdef _WIN32
#include <Windows.h>
#endif

using std::string;
using std::list;

// Error statements
const string GameCtrl::MSG_BAD_ALLOC = "Not enough memory to run the game.";
const string GameCtrl::MSG_LOSE = "Oops! You lose!";
const string GameCtrl::MSG_WIN = "Congratulations! You Win!";
const string GameCtrl::MSG_ESC = "Game ended.";
const string GameCtrl::MAP_INFO_FILENAME = "movements.txt";
int select_path=0; //Select Min Path or Max Path

GameCtrl::GameCtrl() {}

// class Destroyer
GameCtrl::~GameCtrl() {
    delete map;
    map = nullptr;
    if (movementFile) {
        fclose(movementFile);
        movementFile = nullptr;
    }
}

// Return the class instance's address
// Return instance will be used for creating and running game in main functio
GameCtrl* GameCtrl::getInstance(int n) {

    static GameCtrl instance;
	select_path=n;
    return &instance;
}

void GameCtrl::setFPS(const double fps_) {
    fps = fps_;
}

// set program enable AI based search to decide next point to visit
// enableAI_(parameter) is boolean type whether the program use AI based search or not
void GameCtrl::setEnableAI(const bool enableAI_) {
    enableAI = enableAI_;
}


// set program enable Hamilton search to decide next point to visit
// enableHamilton_(parameter) is boolean type whether the program use Hamilton based search or not
{'fraction_non_alphanumeric': 0.10378912685337727, 'fraction_numerical': 0.0019769357495881385, 'mean_word_length': 4.460431654676259, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6912475', 'n_tokens_mistral': 921, 'n_tokens_neox': 900, 'n_words': 329}