blob: 411f89058ed70c515771a6566d39dabbdcb9c00b (
plain) (
blame)
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
|
//
// Created by thecharlesblake on 10/28/17.
//
#ifndef SOLVITAIRE_PILE_H
#define SOLVITAIRE_PILE_H
#include <vector>
#include <iterator>
#include "sol_rules.h"
#include "card.h"
class pile {
public:
typedef uint8_t size_type;
pile() = default;
pile(std::vector<card>);
pile(std::initializer_list<card>);
// Inspect
card top_card() const;
bool empty() const;
size_type size() const;
// Modify
void place(card);
card take();
// Indexes the vector, with the top card as index 0
card& operator[] (size_type);
card operator[] (size_type) const;
friend bool operator==(const pile&, const pile&);
friend std::size_t hash_value(pile const&);
private:
// Underlying vector
std::vector<card> pile_vec;
};
#endif //SOLVITAIRE_PILE_H
|