Smartcar Shield
SimpleCar.hpp
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include "../../control/Control.hpp"
8 #include "../Car.hpp"
9 
10 class SimpleCar : public Car
11 {
12 public:
26  SimpleCar(Control& control);
27 
40  void setSpeed(float speed) override;
41 
42  /* Check `Car` interface for documentation */
43  void setAngle(int angle) override;
44 
45  /* Check `Car` interface for documentation */
46  void overrideMotorSpeed(int firstMotorSpeed, int secondMotorSpeed) override;
47 
48 private:
49  Control& mControl;
50 };
51 
SimpleCar::setAngle
void setAngle(int angle) override
Set the car's driving angle.
Definition: SimpleCar.cpp:17
SimpleCar::SimpleCar
SimpleCar(Control &control)
Constructs a simple car.
Definition: SimpleCar.cpp:7
SimpleCar::setSpeed
void setSpeed(float speed) override
Sets the car's driving speed as a percentage of the motors total speed where the sign indicates direc...
Definition: SimpleCar.cpp:12
SimpleCar::overrideMotorSpeed
void overrideMotorSpeed(int firstMotorSpeed, int secondMotorSpeed) override
Set the motor speed individually as a percentage of the motors` total power.
Definition: SimpleCar.cpp:22
Control
Definition: Control.hpp:23
Car
Definition: Car.hpp:7
SimpleCar
Definition: SimpleCar.hpp:10