-
Notifications
You must be signed in to change notification settings - Fork 0
/
Searchable.h
63 lines (53 loc) · 1.04 KB
/
Searchable.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
54
55
56
57
58
59
60
61
62
63
#pragma once
#include <vector>
#include <memory>
#include "Node.h"
template<class T>
class Searchable
{
private:
std::vector<Node<T>> _nodes;
int _startNode;
int _goalNode;
public:
Searchable();
std::vector<Node<T>>* getNodes();
int getStartNode() const;
int getGoalNode() const;
void setNodes(std::vector<Node<T>> nodes);
void setStartNode(int start);
void setGoalNode(int goal);
};
template<class T>
Searchable<T>::Searchable() : _startNode(0), _goalNode(0)
{}
template<class T>
int Searchable<T>::getStartNode() const
{
return _startNode;
}
template<class T>
int Searchable<T>::getGoalNode() const
{
return _goalNode;
}
template<class T>
void Searchable<T>::setStartNode(int start)
{
_startNode = start;
}
template<class T>
void Searchable<T>::setGoalNode(int goal)
{
_goalNode = goal;
}
template<class T>
std::vector<Node<T>>* Searchable<T>::getNodes()
{
return &_nodes;
}
template<class T>
void Searchable<T>::setNodes(std::vector<Node<T>> nodes)
{
_nodes = nodes;
}