Now iterating over a Frame object

This commit is contained in:
2025-03-26 23:03:23 +01:00
parent 05ba979f58
commit f5e96e7704
7 changed files with 136 additions and 30 deletions
+11
View File
@@ -0,0 +1,11 @@
#ifndef FRAME_H
#define FRAME_H
#include <vector>
using namespace std;
struct Frame {
vector<int> Roll;
};
#endif
+7
View File
@@ -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);
};
+2 -1
View File
@@ -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