juk3n/fluffypublic Fork
⑂ 51d9bb0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/juk3n/fluffy.git
git clone ssh://git@rickub.com/juk3n/fluffy.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

added running game command

Adrian Duraj committed 2024-06-16T21:57:31+02:00 Browse files
51d9bb0 parent: be3af80
modified src/main.cpp +10 -0
@@ -62,6 +62,16 @@ void initialize_database(sqlite3* database) {
6262 printMessage("Database Initialized");
6363 }
6464
65+void runGame(sqlite3* database, std::string gameName) {
66+ std::string pathToRun = "";
67+ for (const auto& [name, path] : games) {
68+ if (name == gameName) {
69+ pathToRun = path;
70+ }
71+ }
72+ system(pathToRun.c_str());
73+}
74+
6575 void handleCommand(int argc, char const *argv[], sqlite3* database) {
6676 std::string command{};
6777 switch (argc) {
@@ -62,6 +62,16 @@ void initialize_database(sqlite3* database) {
62 printMessage("Database Initialized"); 62 printMessage("Database Initialized");
63 }63 }
64 64
65+void runGame(sqlite3* database, std::string gameName) {
66+ std::string pathToRun = "";
67+ for (const auto& [name, path] : games) {
68+ if (name == gameName) {
69+ pathToRun = path;
70+ }
71+ }
72+ system(pathToRun.c_str());
73+}
74+
65 void handleCommand(int argc, char const *argv[], sqlite3* database) {75 void handleCommand(int argc, char const *argv[], sqlite3* database) {
66 std::string command{};76 std::string command{};
67 switch (argc) {77 switch (argc) {