start implementation of routeCache
This commit is contained in:
+7
-1
@@ -11,6 +11,8 @@
|
||||
|
||||
#include "route.h"
|
||||
|
||||
Route Route::routeCache = Route();
|
||||
|
||||
void Route::addPointToRoute(Point point)
|
||||
{
|
||||
this->points.push_back(point);
|
||||
@@ -88,7 +90,7 @@ Point Route::getPreviousPoint()
|
||||
this->currentPoint--;
|
||||
return *this->it;
|
||||
}
|
||||
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
@@ -99,3 +101,7 @@ RouteInfo Route::getRouteInfo()
|
||||
info.currentPoint = this->currentPoint;
|
||||
return info;
|
||||
}
|
||||
|
||||
Route& Route::getRouteCache() {
|
||||
return Route::routeCache;
|
||||
}
|
||||
|
||||
@@ -100,12 +100,16 @@ public:
|
||||
*/
|
||||
bool getStarted() const { return this->started; }
|
||||
|
||||
static Route& getRouteCache();
|
||||
|
||||
private:
|
||||
uint16_t currentPoint = 0;
|
||||
bool started = false;
|
||||
|
||||
std::list<Point> points;
|
||||
std::list<Point>::iterator it;
|
||||
|
||||
static Route routeCache;
|
||||
};
|
||||
|
||||
#endif // ROUTE_H
|
||||
|
||||
Reference in New Issue
Block a user