-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScoreSheet.h
More file actions
44 lines (32 loc) · 1 KB
/
ScoreSheet.h
File metadata and controls
44 lines (32 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef SCORESHEET
#define SCORESHEET
#include <iostream>
#include <string>
#include <vector>
#include "Dice.h"
#include "Row.h"
class ScoreSheet
{
protected:
std::string d_name;
int d_failedThrows;
int d_lockedRows;
int d_points;
std::vector<Row*> d_scoreSheetRows;
virtual bool validate(const RollOfDice _dice, const Color _color, const int _pos = -1) const = 0;
virtual int calcTotal() const = 0;
virtual Row& operator[](const Color _color) = 0;
public:
ScoreSheet(const std::string _name);
virtual ~ScoreSheet() = default;
virtual bool score(RollOfDice _dice, Color _color, int _pos = -1) = 0;
int setTotal();
virtual bool operator!() const;
void addFailedThrow();
//TODO make this part of the score function
void addLockedRow();
virtual std::vector<Color> getUnlockedColorsVector() const;
std::string getName() const { return d_name; }
friend std::ostream& operator<<(std::ostream& _out, const ScoreSheet& _sS);
};
#endif