-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluator.h
executable file
·54 lines (36 loc) · 974 Bytes
/
evaluator.h
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
#pragma once
#include "loader.h"
#include "reels.h"
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <string>
#include <vector>
using std::cout;
using std::endl;
using std::string;
// vector of winning pay indicies of all
// wins based on paylines
using ResultSet = std::vector<int>;
// evaluator only cares about paytables
// and reel windows
struct Evaluator
{
explicit Evaluator(Loader const &);
ResultSet evaluate(ReelWindow const &);
int evaluateNoPrint(ReelWindow const &win);
// look up the details of the pay
string lookup(int pay);
protected:
// hard-coded max of 16 symbols
// used for optimized lookup
int m_primes[16];
std::vector<std::vector<int>> m_paylines;
// how many distinct wins per eval
int m_num_pays = 0;
std::vector<WinTuple> m_pays;
std::vector<string> m_symbols;
// optimized version of pay lookup
std::map<int, int> m_pay_lookup;
};