| 99 | } |
| 100 | |
| 101 | RouteMarkData GetLastPassedPoint(BookmarkManager * bmManager, vector<RouteMarkData> const & points) |
| 102 | { |
| 103 | ASSERT_GREATER_OR_EQUAL(points.size(), 2, ()); |
| 104 | ASSERT(points[0].m_pointType == RouteMarkType::Start, ()); |
| 105 | RouteMarkData data = points[0]; |
| 106 | |
| 107 | for (int i = static_cast<int>(points.size()) - 1; i >= 0; i--) |
| 108 | { |
| 109 | if (points[i].m_isPassed) |
| 110 | { |
| 111 | data = points[i]; |
| 112 | break; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // Last passed point will be considered as start point. |
| 117 | data.m_pointType = RouteMarkType::Start; |
| 118 | data.m_intermediateIndex = 0; |
| 119 | if (data.m_isMyPosition) |
| 120 | { |
| 121 | data.m_position = bmManager->MyPositionMark().GetPivot(); |
| 122 | data.m_isMyPosition = false; |
| 123 | data.m_replaceWithMyPositionAfterRestart = true; |
| 124 | } |
| 125 | |
| 126 | return data; |
| 127 | } |
| 128 | |
| 129 | void SerializeRoutePoint(json_t * node, RouteMarkData const & data) |
| 130 | { |
no test coverage detected