-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoute.cpp
56 lines (40 loc) · 793 Bytes
/
Route.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
#include "Route.h"
Route::Route(string id)// vector<Trip*> , vector<Stop*>)
{
routeID = id;
}
Route::~Route()
{
}
//geters
string Route::getrouteID() const
{
return routeID;
}
vector<Trip*> Route::gettrips() const
{
return trip_ofroute;
}
vector<Stop*> Route::getstops() const
{
return stop_onroute;
}
//seters
void Route::setrouteID(string x)
{
routeID = x;
}
void Route::settrip_ofroute(Trip* x)
{
int a = 0;
for (unsigned int i = 0; i < trip_ofroute.size(); i++)
if (trip_ofroute[i]->gettripID() == x->gettripID()) a = 1;
if (a == 0) trip_ofroute.push_back(x);
}
void Route::setstop_onroute(Stop* x)
{
int a = 0;
for (unsigned int i = 0; i < stop_onroute.size(); i++)
if (stop_onroute[i]->getID() == x->getID()) a = 1;
if (a == 0) stop_onroute.push_back(x);
}