diff options
| author | dawidg81 <dawidgorski.m@gmail.com> | 2026-02-01 12:18:24 +0100 |
|---|---|---|
| committer | dawidg81 <dawidgorski.m@gmail.com> | 2026-02-01 12:18:24 +0100 |
| commit | f53f3515035da5183ab1d05f74a0ffe44b043808 (patch) | |
| tree | 2ee4a474d95a112b859fd59ff33d0a3d46436323 /src | |
| parent | 792d4e4c7e0f736aac837f1ccb77da31127ee253 (diff) | |
removed Utils
Diffstat (limited to 'src')
| -rw-r--r-- | src/Game.cpp | 6 | ||||
| -rw-r--r-- | src/Utils.cpp | 22 | ||||
| -rw-r--r-- | src/Utils.hpp | 9 |
3 files changed, 0 insertions, 37 deletions
diff --git a/src/Game.cpp b/src/Game.cpp index ac04203..988c467 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -1,5 +1,4 @@ #include "Game.hpp" -#include "Utils.hpp" #include <cstdlib> #include <cstdio> @@ -44,19 +43,14 @@ void Game::initBoard() { } int Game::editDiff(){ - Utils util; std::cout << "Now editing custom difficulty" << std::endl; std::cout << "Board width: "; - if(util.catchReturn(util.catchInputInt(&boardWidth)) != 0) return 1; - std::cout << Game::boardWidth; std::cout << "Board height: "; - if(util.catchReturn(util.catchInputInt(&boardHeight)) != 0) return 1; std::cout << "Mines: "; - if(util.catchReturn(util.catchInputInt(&mines)) != 0) return 1; return 0; } diff --git a/src/Utils.cpp b/src/Utils.cpp deleted file mode 100644 index b32b4e8..0000000 --- a/src/Utils.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "Utils.hpp" - -#include <iostream> -#include <ostream> - -int Utils::catchInputInt(int* input){ - std::cin >> *input; - - if (std::cin.fail()) { - std::cout << "error: Input failed" << std::endl; - return 1; - } - - return 0; -} - -int Utils::catchReturn(int renum){ - if (renum != 0) { - std::cout << "Received error signal, sending further" << std::endl; - } - return 0; -} diff --git a/src/Utils.hpp b/src/Utils.hpp deleted file mode 100644 index ffa44a6..0000000 --- a/src/Utils.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#include <string> - -#pragma once - -class Utils{ -public: - int catchInputInt(int* input); - int catchReturn(int renum); -}; |
