aboutsummaryrefslogtreecommitdiff
path: root/PathfindingContext.h
blob: 7c7f173ad9292a18469462e4aa9b6b569795e688 (plain)
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
#pragma once

#include <memory>
#include <vector>

#include "XY.h"
#include "Pathfinder.h"

class Museum;

class PathfindingContext {
public:
	PathfindingContext(Museum &);

public:
	void set_start(const XY & point);
	const XY & get_start() { return this->start_point; }
	void set_end(const XY & point);
	const XY & get_end() { return this->end_point; }
	bool valid_point(const XY & point);

  void update();

private:
	XY start_point = { -1, -1 };
	XY end_point = { -1, -1 };

public:
  Pathfinder & get_solver();
	void cycle_solver();
private:
  std::vector<std::unique_ptr<Pathfinder>> solvers;
  size_t solver_index = 0;

private:
	Museum & museum;
};