Pass gamepad to all objects

This commit is contained in:
2022-12-27 13:38:23 +01:00
parent a4e0007d64
commit 490473c2ee
10 changed files with 29 additions and 21 deletions
@@ -11,8 +11,8 @@
#include "driveModi/Modi/CaptureRoute/captureRoute.h"
CaptureRoute::CaptureRoute(MoveControl* moveControl, Navigation* navigation)
: ManualControl(moveControl) {
CaptureRoute::CaptureRoute(MoveControl* moveControl, Ps3Controller *gamepad, Navigation* navigation)
: ManualControl(moveControl, gamepad) {
this->navigation = navigation;
this->routeInfo = RouteInfo{0, 0};
}
@@ -28,7 +28,7 @@ void CaptureRoute::loop() {
}
void CaptureRoute::runCaptureRoute() {
if (Ps3.data.button.triangle) {
if (this->gamepad->data.button.triangle) {
if (this->navigation->addCurrentPosToRoute()) {
this->routeInfo = navigation->getRouteInfo();
this->updateDisplay = true;
@@ -33,7 +33,7 @@ class CaptureRoute : public ManualControl {
* @param moveControl for ManualControl
* @param navigation to add Points
*/
CaptureRoute(MoveControl* moveControl, Navigation* navigation);
CaptureRoute(MoveControl* moveControl, Ps3Controller *gamepad, Navigation* navigation);
/**
* @brief Calls runCaptureRoute and ManualControl::loop
@@ -50,12 +50,12 @@ class CaptureRoute : public ManualControl {
*/
void runCaptureRoute();
/**
* @brief Get the Navigation object
*
* @return Navigation*
*/
Navigation* getNavigation() const { return this->navigation; }
// /**
// * @brief Get the Navigation object
// *
// * @return Navigation*
// */
// Navigation* getNavigation() const { return this->navigation; }
/**
* @brief Get the Route Info object