-
Notifications
You must be signed in to change notification settings - Fork 0
/
Route.h
81 lines (61 loc) · 1.17 KB
/
Route.h
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
#ifndef ROUTE_H
#define ROUTE_H
#include <string>
#include "Location.h"
using namespace std;
class Location;
const float MULTI = 3;
class Route{
public:
Location* origin;
Location* destination;
string originS;
string destinationS;
string transport;
float time;
float cost;
string note;
Route();
~Route();
Route(Location* org, Location* dest);
Route(Location* org, Location* dest, string trans, float tim, float cst, string notee);
bool doesConnect(Location* start, Location* end);
};
Route::Route(){
origin = NULL;
destination = NULL;
transport = "";
time = 0;
cost = 0;
note = "";
};
Route::~Route(){
};
Route::Route(Location* org, Location* dest){
origin = org;
destination = dest;
transport = "";
time = 0;
cost = 0;
note = "";
};
Route::Route(Location* org, Location* dest, string trans, float tim, float cst, string notee){
origin = org;
destination = dest;
transport = trans;
time = tim;
cost = cst;
note = notee;
if(trans.compare("plane") == 0){
cost = cst * MULTI;
}
};
bool Route::doesConnect(Location* start, Location* end){
if(start == origin && end == destination){
return true;
}
else{
return false;
}
};
#endif