sudo apt-get marks
 
Loading...
Searching...
No Matches
Road Class Reference

Represents a road for public transport vehicles. More...

#include <Transportation.h>

Public Member Functions

 Road (int maxBusses, string type)
 Constructs a Road object.
 
void addBus (PublicTransport bus)
 Adds a bus to the road.
 
string getType () const
 Gets the type of the road.
 
int getNumBusses ()
 Gets the current number of buses on the road.
 
int getMaxNumOfBusses ()
 Gets the maximum number of buses allowed on the road.
 

Detailed Description

Represents a road for public transport vehicles.

This class maintains a list of public transport vehicles and manages their operations.

Constructor & Destructor Documentation

◆ Road()

Road::Road ( int maxBusses,
string type )

Constructs a Road object.

Parameters
maxBussesThe maximum number of buses that can operate on this road.
typeThe type of the road.

Member Function Documentation

◆ addBus()

void Road::addBus ( PublicTransport bus)

Adds a bus to the road.

Parameters
busThe PublicTransport object representing the bus to add.

◆ getMaxNumOfBusses()

int Road::getMaxNumOfBusses ( )

Gets the maximum number of buses allowed on the road.

Returns
The maximum number of buses.

◆ getNumBusses()

int Road::getNumBusses ( )

Gets the current number of buses on the road.

Returns
The current number of buses.

◆ getType()

string Road::getType ( ) const

Gets the type of the road.

Returns
The type of the road.