VehicleManager

API reference for VehicleManager in @erlcjs/core.

Manager responsible for fetching, caching, and updating Vehicle structures.

Signature:

declare class VehicleManager

#Constructors

Constructor

Modifiers

Description

(constructor)(server)

Creates an instance of VehicleManager.

#Properties

Property

Modifiers

Type

Description

cache

Collection<string, Vehicle>

Collection cache of spawned vehicles in the server, keyed by their license plate.

#Methods

Method

Modifiers

Description

fetchAll()

Fetches all active vehicles currently spawned in the game server. Updates the vehicle cache.

updateCache(rawVehicles)

Re-synchronizes the cache with the raw vehicle list from the API. Emits vehicleAdd, vehicleRemove, and vehicleUpdate events.