snakeplusplus/src/main.cpp

25 lines
833 B
C++
Raw Normal View History

#include "gamestate.hpp"
#include <memory>
#include <string>
#include <vector>
#include <iostream>
2024-08-03 18:40:38 -05:00
int main(int argc, char* argv[]) {
std::vector<std::string> args(argv, argv + argc);
g_pEngine = std::make_unique<GameEngine>();
for (int i = 1; i < args.size(); ++i) {
if (args[i].compare("--no-gui") == 0) {
g_pEngine->state.m_bNoDisplay = true;
std::cout << "[LOG - Main] Disabling display" << std::endl;
2024-08-03 18:40:38 -05:00
} else if (args[i].compare("--bot") == 0) {
g_pEngine->state.m_bIsBotControlled = true;
std::cout << "[LOG - Main] Bot control enabled" << std::endl;
} else {
2024-08-03 18:40:38 -05:00
std::cerr << "[ERROR] Argument " << args[i].c_str() << "not found, exiting..." << std::endl;
return 1;
}
}
g_pEngine->Start();
return 0;
}