-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cpp
90 lines (76 loc) · 1.93 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include<iostream>
#include<conio.h>
#include"Console.h"
#include<fstream>
using namespace std;
//输出障碍物坐标
void print_rock(vector<vector<int>> &maze)
{
ofstream OutFileR("Rock.txt");
for (int ii = 0; ii < msizex; ii++)
{
for (int jj = 0; jj < msizey; jj++)
{
if (maze[ii][jj] == 1)
OutFileR << ii << "\t" << jj << endl;
}
}
OutFileR.close();
}
int main()
{
ofstream OutFile("Path1.txt");
Console console;
// init map.
console.Init_map();
// init time.
console.time = 0;
cout<<"1"<<endl;
vector<float_Point *>path = console.ins1.float_Self(console.map,Point(18,1),Point(1,18));
for(auto &p:path)
{
cout<<p->x<<","<<p->y<<endl;
OutFile << p->x << '\t' << p->y << endl;
}
/* vector<Point *>path = console.ins1.Self(console.map,Point(4,4),Point(80,80),true);
for(auto &p:path)
{
cout<<p->x<<","<<p->y<<endl;
OutFile << p->x << '\t' << p->y << endl;
}
*/
/*while(true)
{
console.time++;
console.deleteHurricane();
//风暴
if(0)
{
Point a(25,25);
int delta_time, radius;
console.createHurricane(a, delta_time, radius);
console.refreshAllPath();
}
//加入飞机
if(1)
{
Point start(10,10);
Point end(60,60);
int speed = 1;
if(!console.createNewPlane(start,end,speed))
{
cout<<"wait for calculate."<<endl;
continue;
}
}
//检查是否停止的飞机可以移动
console.StopToMove();
//显示更新以及飞机到达出队
console.refreshPlane();
system("pause");
}*/
OutFile.close(); //关闭Path.txt文件
//输出障碍物坐标 rock.txt
print_rock(console.map);
return 0;
}