-
Notifications
You must be signed in to change notification settings - Fork 40
/
main.cpp
51 lines (48 loc) · 1.4 KB
/
main.cpp
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
#include"mission.h"
#include <iostream>
int main(int argc, char* argv[])
{
if (argc > 1)
{
Mission mission;
if(argc == 5)
mission.setFileNames(argv[1], argv[2], argv[3], argv[4]);
else if(argc == 4)
mission.setFileNames(argv[1], argv[2], argv[3], nullptr);
else if(argc == 2)
mission.setFileNames(argv[1], argv[1], argv[1], argv[1]);
else
{
std::cout<<"Wrong number of input XML-files. It should be either all-in-one file, or three ones: map-file, task-file and config-file.\n";
return 0;
}
if (!mission.getConfig())
return 0;
else
std::cout<<"CONFIG LOADED\n";
if (!mission.getMap())
{
std::cout<<"Program terminated.\n";
return 0;
}
else
std::cout<<"MAP LOADED\n";
if (!mission.getTask())
{
std::cout<<"Program terminated.\n";
return 0;
}
else
std::cout<<"TASK LOADED\n";
if(mission.getObstacles())
{
std::cout<<"OBSTACLES LOADED\n";
}
mission.createSearch();
mission.createLog();
mission.startSearch();
mission.printSearchResultsToConsole();
mission.saveSearchResultsToLog();
}
return 1;
}