Smartcar Shield
Loading...
Searching...
No Matches
SimpleCar.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include "../../control/Control.hpp"
8#include "../Car.hpp"
9
10class SimpleCar : public Car
11{
12public:
26 explicit 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
48private:
49 Control& mControl;
50};
51
An interface to programmatically represent any kind of vehicle.
Definition Car.hpp:8
Interface to generalize all classes that can provide a way to control a Car.
Definition Control.hpp:24
A class to programmatically represent a very basic vehicle with two motors.
Definition SimpleCar.hpp:11
void setAngle(int angle) override
Set the car's driving angle.
Definition SimpleCar.cpp:17
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
void overrideMotorSpeed(int firstMotorSpeed, int secondMotorSpeed) override
Set the motor speed individually as a percentage of the motors` total power.
Definition SimpleCar.cpp:22