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