-
Notifications
You must be signed in to change notification settings - Fork 2
/
wwf_piece_source.hpp
55 lines (45 loc) · 1.48 KB
/
wwf_piece_source.hpp
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
52
53
54
55
#ifndef wwf_piece_source_h
#define wwf_piece_source_h
#include "scrabble_piece.hpp"
#include "scrabble_exception.hpp"
#include "piece_source.hpp"
#include <vector>
class Scrabble_Game;
class Point_Map;
/**
* This class implements a piece source that you'd expect in a wwf scrabble
* game. It has 100 pieces with the wwf letter distributions:
*
* 13 E
* 9 A
* 8 I O
* 7 T
* 6 R
* 5 D N S
* 4 H L U
* 3 G
* 2 B C F M P V W Y -
* 1 J K Q X Z
*
* This class works by creating all the pieces above, placing them in a vector
* and then shuffling the vector so that the piece order is random. As the
* outside requests pieces, we simply iterate over this vector.
*/
////////////////////////////////////////////////////////////////////////////////
class Wwf_Piece_Source : public Piece_Source
////////////////////////////////////////////////////////////////////////////////
{
public:
/**
* Constructor - Populates the piece source
*/
Wwf_Piece_Source(const Scrabble_Game& parent);
virtual const Point_Map& get_point_map() const;
private: // ================ PRIVATE INTERFACE ================================
//////////////////////////////////////////////////////////////////////////////
////////////////////////// FORBIDDEN METHODS /////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Wwf_Piece_Source(const Wwf_Piece_Source&) = delete;
Wwf_Piece_Source& operator=(const Wwf_Piece_Source&) = delete;
};
#endif