My Project
|
The main class to define bus. More...
#include <bus.h>
Public Member Functions | |
Bus (std::string name, Route *out, Route *in, int capacity=60, double speed=1) | |
Constructs a bus with a standard name, two route pointers, passenger capacity and speed. More... | |
bool | LoadPassenger (Passenger *) |
bool | Move () |
Method to decide if the bus is moving. More... | |
void | Update () |
Method to update the status of bus. More... | |
void | Report (std::ostream &out) |
bool | IsTripComplete () |
Method to indicate if the bus complete all routes. More... | |
int | UnloadPassengers (Stop *stop) |
Method to unload passenger to a stop. More... | |
void | UpdateBusData () |
Method to update bus data. More... | |
BusData | GetBusData () |
Getter of bus data. More... | |
std::string | GetName () const |
Getter of bus name. More... | |
Stop * | GetNextStop () |
Getter of pointer to next stop. | |
Stop * | GetPreviousStop () |
Getter of pointer to previous stop. | |
size_t | GetNumPassengers () |
Getter of number of passengers on bus. More... | |
int | GetCapacity () |
Getter of pointer to bus capacity. | |
The main class to define bus.
BusData Bus::GetBusData | ( | ) |
Getter of bus data.
std::string Bus::GetName | ( | ) | const |
Getter of bus name.
size_t Bus::GetNumPassengers | ( | ) |
Getter of number of passengers on bus.
bool Bus::IsTripComplete | ( | ) |
Method to indicate if the bus complete all routes.
bool Bus::Move | ( | ) |
Method to decide if the bus is moving.
If not moving, it reaches to a stop
int Bus::UnloadPassengers | ( | Stop * | stop | ) |
Method to unload passenger to a stop.
void Bus::Update | ( | ) |
Method to update the status of bus.
It update the distance to next stop, indicators to next stop, status of every passenger on bus It involves load and unload passengers at stops
void Bus::UpdateBusData | ( | ) |
Method to update bus data.