aboutsummaryrefslogtreecommitdiff
path: root/src/main/sol_rules.h
blob: aadda69db8ba6439901a3ce67dd944321850e5e6 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// Created by thecharlesblake on 10/28/17.
//

#ifndef SOLVITAIRE_SOL_RULES_H
#define SOLVITAIRE_SOL_RULES_H

#include <vector>
#include <string>

class sol_rules {
public:
    enum class valid_sol {
        BLACK_HOLE,
        SIMPLE_BLACK_HOLE,
        SPANISH_PATIENCE,
        SIMPLE_SPANISH_PATIENCE,
        FREE_CELL,
        SIMPLE_FREE_CELL,
        CANFIELD,
        SIMPLE_CANFIELD
    };
    enum class build_order {
        NO_BUILD,
        DESCENDING,
        ASCENDING,
        BOTH,
        SINGLE_CARD
    };
    enum class build_policy {
        CLUBS,
        DIAMONDS,
        HEARTS,
        SPADES,
        ANY_SUIT,
        SAME_SUIT,
        RED_BLACK
    };

    static std::vector<std::string> valid_sol_strs;
    static bool is_suit(build_policy);
    static int suit_val(build_policy);

    sol_rules(std::string);

    int tableau_pile_count;
    build_order build_ord;
    build_policy build_pol;
    int max_rank;
    bool hole;
    bool foundations;
    int cells;
    int reserve_size;
    int stock_size;

private:
    static valid_sol valid_sol_enum(const std::string&);
};

#endif //SOLVITAIRE_SOL_RULES_H