-
Notifications
You must be signed in to change notification settings - Fork 0
/
AutoSweep.h
42 lines (30 loc) · 1004 Bytes
/
AutoSweep.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
#ifndef _AUTO_SWEEP_H
#define _AUTO_SWEEP_H
#include "SweepAction.h"
#include "MineField.h"
#include <vector>
// Abstract base class defining the AutoSweep solver interface
class AutoSweep
{
public:
// this method gets called every time a new game is started
virtual void startNewGame(int total_num_mines = -1) = 0;
// this gets called to generate new sweep actions as long as we are still alive
virtual bool sweep(const MineField* mf) = 0;
// called by the user/simulator to access actions generated by sweep()
const std::vector<SweepAction>& getSweepActions()
{
return _actions;
}
// static utility function for loading shared library solvers
static AutoSweep* loadSolver(const std::string& name);
protected:
void addAction(const SweepAction& action)
{
_actions.push_back(action);
}
void updateModel(const MineField* mf);
MineField _model;
std::vector<SweepAction> _actions;
};
#endif // _AUTO_SWEEP_H