-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (29 loc) · 817 Bytes
/
main.cpp
File metadata and controls
34 lines (29 loc) · 817 Bytes
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
#include "main.h"
// using namespace NAVIGATION;
namespace NAVIGATION
{
Navigate::Navigate()
{
Node start_node(6, 5, NodeType::start);
Node end_node(28, 40, NodeType::end);
grid_map_ptr = make_unique<GridMap>(start_node, end_node);
system("pause");
}
bool Navigate::process(const int& _dist_type, const int& _algo_type)
{
strategy_ptr = make_unique<AStar>(_dist_type, _algo_type);
return strategy_ptr->search(grid_map_ptr, result_nodes);
}
}
int main()
{
initgraph(WIDTH, HEIGHT, EW_SHOWCONSOLE); //init easyX
unique_ptr<NAVIGATION::Navigate> navigate_ptr = make_unique<NAVIGATION::Navigate>();
if (navigate_ptr->process(NAVIGATION::DistType::Manhattan, NAVIGATION::AlgoType::Astar))
{
cout << "Navigation complete" << endl;
}
system("pause");
closegraph(); //close window
return 0;
}