Made code style more consistent, use const reference in parameters, and removed a redundant check
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
#ifndef FILEHELPER_H
|
||||
#define FILEHELPER_H
|
||||
|
||||
class FileHelper {
|
||||
public:
|
||||
FileHelper() = default;
|
||||
|
||||
~FileHelper() = default;
|
||||
|
||||
static bool fileExists(char *path);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -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);
|
||||
@@ -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
|
||||
@@ -13,7 +13,7 @@ class ScoreCalculator {
|
||||
|
||||
~ScoreCalculator() = default;
|
||||
|
||||
static int getScore(vector<Frame> rolls);
|
||||
static int getScore(const vector<Frame>& frames);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user