本文整理汇总了C++中Gate::NewPlaneCoords方法的典型用法代码示例。如果您正苦于以下问题:C++ Gate::NewPlaneCoords方法的具体用法?C++ Gate::NewPlaneCoords怎么用?C++ Gate::NewPlaneCoords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gate
的用法示例。
在下文中一共展示了Gate::NewPlaneCoords方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main () {
textmode (ATC_TEXT_MODE);
clrscr();
Position::MaxX = 30;
Position::MaxY = 30;
char pid;
Position::MaxX = 30;
Position::MaxY = 30;
RadarScreen *r;
Landmarks l;
Traffic t;
Plane *p1;
Gate g (Position (0, 10), 1, D90);
Gate g1 (Position (0, 0), 2, D45);
Gate g2 (Position (10, 0), 3, D0);
Gate g3 (Position (MAX_X, MAX_Y), 4, D225);
// Gate g4 (Position (10, 0), 4, D0);
Airport a1 (Position (5, 5), 1, Heading (D90));
Airport a2 (Position (10, 12), 2, Heading (D45));
Beacon b1 (Position (7,13), 1);
Beacon b2 (Position (1,1), 2);
FlightPath fp (Position (MIN_FIELD_X, MIN_FIELD_Y),
Position (MAX_FIELD_X, MAX_FIELD_Y));
FlightPath fp1 (Position (MIN_FIELD_X, MAX_FIELD_Y),
Position (MAX_FIELD_X, MIN_FIELD_Y));
FlightPath fp2 (Position (10, 1), Position (10, MAX_FIELD_Y));
int i;
l.AddAirport (&a1);
l.AddAirport (&a2);
l.AddBeacon (&b1);
l.AddBeacon (&b2);
l.AddGate (&g);
l.AddGate (&g1);
l.AddGate (&g2);
l.AddGate (&g3);
// l.AddGate (&g4);
l.AddFlightPath (&fp);
l.AddFlightPath (&fp1);
l.AddFlightPath (&fp2);
r = new RadarScreen (&l);
Boolean Crashed = False;
r->Refresh();
pid = t.NewId();
p1 = new Plane (pid, g.NewPlaneCoords(), Prop, &g1);
t.NewAirborne (p1);
p1 = new Plane (t.NewId(), g1.NewPlaneCoords(), Jet, &g);
t.NewAirborne (p1);
p1 = new Plane (t.NewId(), g2.NewPlaneCoords(), Jet, &g);
t.NewAirborne (p1);
r->DisplayPlanes (&t);
for (i = 0; i < 34; i++) {
delay (500);
if (i == 17) {
t.SearchAirborne ('a');
t.FoundAirborne() -> AlterTargHeading (D270, AntiClockwise);
t.SearchAirborne ('b');
t.FoundAirborne() -> MakeCircle (AntiClockwise);
}
r->UnDisplayPlanes (&t);
if (i % 2 == 0) {
t.StepJets();
} else {
t.StepAll();
}
r->DisplayPlanes (&t);
if (!Crashed && t.Crashed ()) {
cout << '\a';
Crashed = True;
//.........这里部分代码省略.........