-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathEngineThread.h
44 lines (40 loc) · 1.11 KB
/
EngineThread.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
#ifndef ENGINETHREAD_H
#define ENGINETHREAD_H
#include "stdafx.h"
#include "GameState.h"
#include "Utils.h"
#include <atomic>
class MainFrame;
using Utils::ThreadGroup;
class TEngineThread {
public:
TEngineThread(const GameState& gamestate, MainFrame * frame);
void Wait();
void Run();
void limit_visits(int visits);
void set_resigning(bool res);
void set_analyzing(bool flag);
void set_pondering(bool flag);
void set_nopass(bool flag);
void set_quiet(bool flag);
void set_nets(bool flag);
void stop_engine(void);
void kill_score_update(void);
GameState& get_state(void) {
return *m_state;
}
private:
std::unique_ptr<GameState> m_state;
MainFrame * m_frame;
int m_maxvisits;
bool m_nets;
bool m_resigning;
bool m_analyseflag;
bool m_pondering;
bool m_quiet;
bool m_nopass;
bool m_update_score;
ThreadGroup m_tg{thread_pool};
std::atomic<bool> m_runflag;
};
#endif