Now iterating over a Frame object
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#ifndef FRAME_H
|
||||
#define FRAME_H
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
struct Frame {
|
||||
vector<int> Roll;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../include/Frame.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -14,6 +15,12 @@ class NumberHelper {
|
||||
|
||||
static vector<int> getRolls(string csv);
|
||||
static bool validateRolls(vector<int> rolls);
|
||||
static vector<Frame> createFrames(vector<int> rolls);
|
||||
|
||||
private:
|
||||
static Frame CreateStrikeFrame(int i);
|
||||
static Frame CreateFreeFrame(int i, int j);
|
||||
static Frame CreateBonusFrame(int i, int j, int k);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../include/Frame.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -12,7 +13,7 @@ class ScoreCalculator {
|
||||
|
||||
~ScoreCalculator() = default;
|
||||
|
||||
static int getScore(vector<int> rolls);
|
||||
static int getScore(vector<Frame> rolls);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user