VehicleProvider

Responsible for the control, access, and listening to changes in the vehicle state.

Properties

Link copied to clipboard

The default vehicle is a car with a combustion engine.

Link copied to clipboard

Setting a different vehicle notifies registered VehicleUpdatedListeners of the latest vehicle state.

Functions

Link copied to clipboard

Adds a VehicleUpdatedListener which will be notified about any vehicle update.

Link copied to clipboard
Link copied to clipboard
fun reset(vehicle: Vehicle = DEFAULT_VEHICLE)

Sets vehicle to default value and removes all subscribed listeners.

Link copied to clipboard

Updates the properties of the vehicle. The only properties that can be updated are those defined by the currently set vehicle.