-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFlight.cpp
More file actions
77 lines (65 loc) · 1.34 KB
/
Copy pathFlight.cpp
File metadata and controls
77 lines (65 loc) · 1.34 KB
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
#include <utility>
#include <fstream>
#include "Flight.hpp"
using namespace std;
ostream& operator<< (ostream& out, Flight& flight)
{
out << flight.time.first<<" ";
out << flight.time.second<<" ";
out << flight.coord.first << " ";
out << flight.coord.second << " ";
out << flight.speed << " ";
out << flight.altitude << " ";
return out;
}
istream& operator>> (istream& in, Flight& flight)
{
in >> flight.time.first;
in >> flight.time.second;
in >> flight.coord.first;
in >> flight.coord.second;
in >> flight.speed;
in >> flight.altitude;
return in;
}
Flight Flight::operator = (const Flight &flight)
{
if (&flight == this)
return *this;
(this->speed = flight.speed,
this->altitude = flight.altitude,
this->coord = flight.coord,
this->time = flight.time);
}
void Flight::setSpeed(int _speed)
{
speed = _speed;
}
void Flight::setAltitude(int _altitude)
{
altitude = _altitude;
}
void Flight::setCoord(pair<float, float> _coord)
{
coord = _coord;
}
void Flight::setTime(pair<int, int> _time)
{
time = _time;
}
int Flight::getSpeed()
{
return speed;
}
int Flight::getAltitude()
{
return altitude;
}
pair<float, float> Flight::getCoord()
{
return coord;
}
pair<int, int> Flight::getTime()
{
return time;
}