-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrip.cpp
48 lines (38 loc) · 851 Bytes
/
Trip.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
#include "Trip.h"
Trip::Trip(string a, string b) // vector<pair<Stop*, string>>, string b)
{
tripID = a;
direction_onroute = b;
}
Trip::~Trip()
{
}
//geters
string Trip::gettripID() const
{
return tripID;
}
vector<pair<Stop*, pair<int, int>>> Trip::getstop_time_ontrip() const
{
return stop_time_ontrip;
}
string Trip::getdirection() const
{
return direction_onroute;
}
//seters
void Trip::settripID(string x)
{
tripID = x;
}
void Trip::setstop_time_ontrip(Stop* x, int z, int k)
{
int a = 0;
for (unsigned int i = 0; i < stop_time_ontrip.size(); i++)
if (stop_time_ontrip[i].first->getID() == x->getID() && stop_time_ontrip[i].second.first == z && stop_time_ontrip[i].second.second == k) a = 1;
if (a == 0) stop_time_ontrip.push_back(make_pair(x, make_pair(z, k)));
}
void Trip::setdirection(string y)
{
direction_onroute = y;
}