Made code style more consistent, use const reference in parameters, and removed a redundant check

This commit is contained in:
2025-03-27 18:05:20 +01:00
parent 1e51718b04
commit efc1b264b8
12 changed files with 37 additions and 109 deletions
-13
View File
@@ -1,13 +0,0 @@
#ifndef FILEHELPER_H
#define FILEHELPER_H
class FileHelper {
public:
FileHelper() = default;
~FileHelper() = default;
static bool fileExists(char *path);
};
#endif
-18
View File
@@ -1,18 +0,0 @@
#ifndef FILEREADER_H
#define FILEREADER_H
#include <string>
#include <vector>
using namespace std;
class FileReader {
public:
FileReader() = default;
~FileReader() = default;
static string getFile(char *path);
};
#endif
@@ -1,5 +1,5 @@
#ifndef NUMBERHELPER_H
#define NUMBERHELPER_H
#ifndef NUMBERUTILS_H
#define NUMBERUTILS_H
#include <string>
#include <vector>
@@ -7,15 +7,15 @@
using namespace std;
class NumberHelper {
class NumberUtils {
public:
NumberHelper() = default;
NumberUtils() = default;
~NumberHelper() = default;
~NumberUtils() = default;
static vector<int> getRolls(string csv);
static bool validateRolls(vector<int> rolls);
static vector<Frame> createFrames(vector<int> rolls);
static vector<int> getRolls(const string& csv);
static bool validateRolls(const vector<int>& rolls);
static vector<Frame> createFrames(const vector<int>& rolls);
private:
static Frame createStrikeFrame(int i);
+2 -2
View File
@@ -14,8 +14,8 @@ class PrintFrames {
~PrintFrames() = default;
static void printHeader();
static void printValue(string values);
static string parseValue(vector<Frame> frames);
static void printValue(const string& value);
static string parseValue(const vector<Frame>& frames);
};
#endif
+1 -1
View File
@@ -13,7 +13,7 @@ class ScoreCalculator {
~ScoreCalculator() = default;
static int getScore(vector<Frame> rolls);
static int getScore(const vector<Frame>& frames);
};
#endif