-
Notifications
You must be signed in to change notification settings - Fork 0
/
simulator.h
53 lines (48 loc) · 1.16 KB
/
simulator.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
#pragma once
#include <yaml-cpp/yaml.h>
#include <vector>
#include <iostream>
#include "deck.h"
#include "context.h"
#include "condition.h"
namespace YGO {
using condition_set_t = std::set<YGO::Condition*, YGO::ConditionPtrCompare>;
class Game;
class Simulator
{
int m_count;
bool m_debug;
bool m_show_ci;
struct Combo {
t_string name;
t_string score = "1";
t_string condition;
std::vector<t_string> hand_condition_strings;
std::vector<Condition*> hand_conditions;
std::vector<t_string> grave_condition_strings;
std::vector<Condition*> grave_conditions;
int test(Game& g);
void bind(Context& context);
void print(std::ostream& os);
};
public:
struct Topic {
t_string name;
std::vector<Combo> m_combos;
int m_start_card;
bool m_exec_program;
t_string m_header;
int test(Game& g);
void bind(Context& context);
void print(std::ostream& os);
condition_set_t get_wanted_hand_conds() const;
condition_set_t get_wanted_grave_conds() const;
};
std::vector<Topic> m_topics;
Simulator(YAML::Node simulate);
void run(const Deck& deck, Context& context);
bool is_debug() const {
return m_debug;
}
};
}