-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDice.h
More file actions
36 lines (29 loc) · 741 Bytes
/
Dice.h
File metadata and controls
36 lines (29 loc) · 741 Bytes
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
#ifndef DICE
#define DICE
#include <iostream>
#include <vector>
#include <random>
#include <list>
#include <ctime>
enum Color {INVALID, RED, YELLOW, GREEN, BLUE, WHITE_1, WHITE_2};
struct RandomDice
{
static std::uniform_int_distribution<int> die;
static std::default_random_engine generator;
};
struct Dice
{
Dice(Color _color);
const Color d_color;
int d_face;
int roll();
friend std::ostream& operator<<(std::ostream& _out, const Dice& _dice);
};
struct RollOfDice : public std::vector<Dice>
{
RollOfDice roll();
RollOfDice pair(const int _index1, const int _index2) const;
operator int() const;
friend std::ostream& operator<<(std::ostream& _out, const RollOfDice& _roll);
};
#endif