1 | #include "Lane.h" |
---|---|
2 | |
3 | #include <LaneType.h> |
4 | |
5 | Lane::Lane(LaneType type) |
6 | : mType(type) |
7 | { |
8 | } |
9 | |
10 | bool Lane::isHead() const |
11 | { |
12 | return mType == LaneType::HEAD || mType == LaneType::HEAD_R || mType == LaneType::HEAD_L; |
13 | } |
14 | |
15 | bool Lane::isTail() const |
16 | { |
17 | return mType == LaneType::TAIL || mType == LaneType::TAIL_R || mType == LaneType::TAIL_L; |
18 | } |
19 | |
20 | bool Lane::isJoin() const |
21 | { |
22 | return mType == LaneType::JOIN || mType == LaneType::JOIN_R || mType == LaneType::JOIN_L; |
23 | } |
24 | |
25 | bool Lane::isFreeLane() const |
26 | { |
27 | return mType == LaneType::NOT_ACTIVE || mType == LaneType::CROSS || isJoin(); |
28 | } |
29 | |
30 | bool Lane::isMerge() const |
31 | { |
32 | return mType == LaneType::MERGE_FORK || mType == LaneType::MERGE_FORK_R || mType == LaneType::MERGE_FORK_L; |
33 | } |
34 | |
35 | bool Lane::isActive() const |
36 | { |
37 | return mType == LaneType::ACTIVE || mType == LaneType::INITIAL || mType == LaneType::BRANCH || isMerge(); |
38 | } |
39 |