OpenMod Docs OpenMod Docs
OpenMod Docs OpenMod Docs
OpenMod .NET Plugin Framework.

Class VehicleDirectoryExtensions

Inheritance
System.Object
VehicleDirectoryExtensions
Namespace: OpenMod.Extensions.Games.Abstractions.Vehicles
Assembly: OpenMod.Extensions.Games.Abstractions.dll
Syntax
public static class VehicleDirectoryExtensions : object

Methods

| Improve this Doc View Source

FindByIdAsync(IVehicleDirectory, String)

Searches for vehicles by the vehicle asset id.

Declaration
public static Task<IVehicleAsset> FindByIdAsync(this IVehicleDirectory directory, string vehicleAssetId)
Parameters
Type Name Description
IVehicleDirectory directory

The vehicle directory service.

System.String vehicleAssetId

The vehicle asset id to search for.

Returns
Type Description
Task<IVehicleAsset>

The IVehicleAsset if found; otherwise, null.

| Improve this Doc View Source

FindByNameAsync(IVehicleDirectory, String, Boolean)

Searches for vehicles by the vehicle asset name.

Declaration
public static Task<IVehicleAsset> FindByNameAsync(this IVehicleDirectory directory, string vehicleName, bool exact = true)
Parameters
Type Name Description
IVehicleDirectory directory

The item directory service.

System.String vehicleName

The name of the vehicle asset.

System.Boolean exact

If true, only exact name matches will be used.

Returns
Type Description
Task<IVehicleAsset>

The IVehicleAsset if found; otherwise, null.