-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroad.h
55 lines (42 loc) · 868 Bytes
/
road.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
#ifndef ROAD_H
#define ROAD_H
#include <string>
class Road
{
unsigned N;
std::string A, B;
public:
Road();
Road(unsigned N, std::string A, std::string B){
this->A = A;
this->B = B;
this->N = N;
}
Road(const Road& X){
this->A = X.A;
this->B = X.B;
this->N = X.N;
}
inline bool isRoad(std::string X){
return (X == A) || (X == B);
}
inline bool isNeighbor(Road X){
return (A == X.A) || (A == X.B) || (B == X.A) || (B == X.B);
}
inline bool isNeighborDirectly(Road X){
return (B == X.A);
}
inline bool isRoad(unsigned X){
return X==N;
}
inline std::string getA(){
return A;
}
inline std::string getB(){
return B;
}
inline unsigned getN(){
return N;
}
};
#endif // ROAD_H