#include <Gradient.h>
Public Member Functions | |
void | addVehicle (Vehicle *pVeh) |
void | removeVehicle (Vehicle *pVeh) |
Gradient (int start, int end, double grad, bool DirPos) | |
virtual | ~Gradient () |
Private Attributes | |
double | m_Gradient |
Definition at line 17 of file Gradient.h.
Gradient::Gradient | ( | int | start, | |
int | end, | |||
double | grad, | |||
bool | DirPos | |||
) |
Definition at line 19 of file Gradient.cpp.
References RoadSegment::m_Beginning, RoadSegment::m_DirPos, RoadSegment::m_End, and m_Gradient.
00020 { 00021 m_Beginning = start; 00022 m_End = end; 00023 m_DirPos = DirPos; 00024 m_Gradient = grad; 00025 }
Gradient::~Gradient | ( | ) | [virtual] |
void Gradient::addVehicle | ( | Vehicle * | pVeh | ) | [virtual] |
Reimplemented from RoadSegment.
Definition at line 32 of file Gradient.cpp.
References Vehicle::getDriver(), m_Gradient, and DriverModel::SetGradient().
00033 { 00034 pVeh->getDriver()->SetGradient(m_Gradient); 00035 }
void Gradient::removeVehicle | ( | Vehicle * | pVeh | ) | [virtual] |
Reimplemented from RoadSegment.
Definition at line 37 of file Gradient.cpp.
References DriverModel::ClearGradient(), and Vehicle::getDriver().
00038 { 00039 // TRACE("Remove vehicle - Direction: %d Position: %f\tVelocity: %f\n",pVeh->getDirection(), pVeh->getPos(), pVeh->getVelocity()); 00040 DriverModel* driver = pVeh->getDriver(); // called before add vehicle!! 00041 driver->ClearGradient(); // causes vehicle stream to halt 00042 }
double Gradient::m_Gradient [private] |