Cleaned up main.cpp
This commit is contained in:
parent
efc1b264b8
commit
35cd28b6be
@ -13,8 +13,11 @@ class PrintFrames {
|
||||
|
||||
~PrintFrames() = default;
|
||||
|
||||
|
||||
static void printResult(const vector<Frame>& frames);
|
||||
|
||||
private:
|
||||
static void printHeader();
|
||||
static void printValue(const string& value);
|
||||
static string parseValue(const vector<Frame>& frames);
|
||||
};
|
||||
|
||||
|
@ -2,12 +2,13 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
void PrintFrames::printHeader() {
|
||||
cout << "| f1 | f2 | f3 | f4 | f5 | f6 | f7 | f8 | f9 | f10 |" << endl;
|
||||
void PrintFrames::printResult(const vector<Frame>& frames) {
|
||||
printHeader();
|
||||
cout << parseValue(frames);
|
||||
}
|
||||
|
||||
void PrintFrames::printValue(const string& value) {
|
||||
cout << value;
|
||||
void PrintFrames::printHeader() {
|
||||
cout << "| f1 | f2 | f3 | f4 | f5 | f6 | f7 | f8 | f9 | f10 |" << endl;
|
||||
}
|
||||
|
||||
string PrintFrames::parseValue(const vector<Frame>& frames) {
|
||||
|
@ -27,10 +27,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
vector<Frame> frames = NumberUtils::createFrames(rolls);
|
||||
|
||||
string values = PrintFrames::parseValue(frames);
|
||||
|
||||
PrintFrames::printHeader();
|
||||
PrintFrames::printValue(values);
|
||||
PrintFrames::printResult(frames);
|
||||
|
||||
int score = ScoreCalculator::getScore(frames);
|
||||
cout << "Score: " << score << endl;
|
||||
|
Loading…
Reference in New Issue
Block a user