-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyahtzee.cpp
51 lines (41 loc) · 928 Bytes
/
yahtzee.cpp
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
45
46
47
48
49
50
51
#include "yahtzee.hpp"
#include <vector>
#include <string>
#include <iostream>
#include <utility>
#include "diceroll.hpp"
#include "scoresheet.hpp"
#include "ruletypes.hpp"
#include "rule.hpp"
using std::vector;
using std::string;
using std::ostream;
using std::pair;
using std::make_pair;
namespace cs427_527
{
YahtzeeGame::YahtzeeGame(vector<Rule> r ) : rules{r}
{
}
Scoresheet YahtzeeGame::initialSheet() const
{
vector<string> unused;
vector<pair<int, string>> score;
for(auto it = rules.begin(); it != rules.end(); it++)
{
if((*it).isPlayable())
{
unused.push_back((*it).getAbbrev());
}
score.push_back(make_pair(-1, (*it).getName()));
}
return Scoresheet(score, unused);
}
bool YahtzeeGame::isTerminal(const Scoresheet sheet) const
{
return true;
}
void YahtzeeGame::scoreRoll(DiceRoll roll, string cat, Scoresheet sheet) const
{
}
}