10 #include "VehicleType.hpp"
17 static std::vector<std::shared_ptr<VehicleType>> _vehicleType;
20 int _previousPosition = -1;
23 double _velocity = 0.;
24 int _timeTraveled = 0;
29 : _index(v._index), _position(v._position),
30 _previousPosition(v._previousPosition), _street(v._street),
31 _timePenalty(v._timePenalty), _velocity(v._velocity),
32 _timeTraveled(v._timeTraveled) {}
39 static std::shared_ptr<VehicleType>
Vehicle class.
Definition: Vehicle.hpp:15
void setTimePenalty(int)
Set the time penalty of the vehicle.
Definition: Vehicle.cpp:126
void setVelocity(double)
Set the velocity of the vehicle.
Definition: Vehicle.cpp:145
Vehicle(int)
create a vehicle of a type in _vehicleType
Definition: Vehicle.cpp:11
uint16_t getPosition() const noexcept
Get the position of the vehicle.
Definition: Vehicle.cpp:108
static std::shared_ptr< VehicleType > getVehicleType(int8_t const)
get a vehicle type from _vehicleType
Definition: Vehicle.cpp:76
uint16_t getDestination() const noexcept
Get the destination of the vehicle.
Definition: Vehicle.cpp:136
double getVelocity() const noexcept
Get the velocity of the vehicle.
Definition: Vehicle.cpp:155
void incrementTimeTraveled() noexcept
Increment the time traveled by the vehicle.
Definition: Vehicle.cpp:157
static uint8_t getNVehicleType()
get the number of vehicle types in _vehicleType
Definition: Vehicle.cpp:89
int getPreviousPosition() const noexcept
Get the previous position of the vehicle.
Definition: Vehicle.cpp:113
int getTimeTraveled() const noexcept
Get the time traveled by the vehicle.
Definition: Vehicle.cpp:160
static void addVehicleType(int, int)
add a vehicle type in _vehicleType
Definition: Vehicle.cpp:24
int getTimePenalty() const noexcept
Get the time penalty of the vehicle.
Definition: Vehicle.cpp:141
int getStreet() const
Get the street of the vehicle.
Definition: Vehicle.cpp:122
void resetTimeTraveled() noexcept
Reset the time traveled by the vehicle, setting it to 0.
Definition: Vehicle.cpp:162
uint8_t getType() const noexcept
Get the vehicle type index.
Definition: Vehicle.cpp:86
void setStreet(int)
Set the street of the vehicle.
Definition: Vehicle.cpp:118
void setPosition(int)
Set the position of the vehicle.
Definition: Vehicle.cpp:96