public class VehicleModelCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.io.File |
DIR |
static java.io.File |
ICON_DIR |
Constructor and Description |
---|
VehicleModelCache() |
Modifier and Type | Method and Description |
---|---|
void |
addVehicle(VehicleModelInfo vehicle)
Add a vehicle to the cache (typically used by plugins)
|
void |
dispose() |
VehicleModelInfo |
get(java.lang.String category,
java.lang.String vehicle)
Get specific vehicle model based on the vehicle category and type
|
java.util.List<VehicleModelInfo> |
getAll()
Get all vehicle model data
|
java.util.List<VehicleModelInfo> |
getAll(java.lang.String category)
Get all vehicle model data for a given category
|
java.util.List<java.lang.String> |
getCategories()
Get a list of all vehicle categories sorted alphabetically
|
static VehicleModelCache |
getInstance() |
boolean |
registerUsage(VehicleModelInfo info,
java.lang.String uid)
Register usage of a specific vehicle model
|
void |
removeVehicle(VehicleModelInfo vehicle)
Remove vehicle from the cache (typically used by plugins)
|
void |
rescan()
Rescan the atak/tools/vehicles/models directory
|
boolean |
unregisterUsage(VehicleModelInfo info,
java.lang.String uid)
Unregister usage of a specific vehicle model
|
public static final java.io.File DIR
public static final java.io.File ICON_DIR
public static VehicleModelCache getInstance()
public VehicleModelInfo get(java.lang.String category, java.lang.String vehicle)
category
- Vehicle categoryvehicle
- Vehicle type (i.e. C-130)public java.util.List<VehicleModelInfo> getAll()
public java.util.List<VehicleModelInfo> getAll(java.lang.String category)
category
- Vehicle categorypublic java.util.List<java.lang.String> getCategories()
public void addVehicle(VehicleModelInfo vehicle)
vehicle
- Vehicle info to addpublic void removeVehicle(VehicleModelInfo vehicle)
vehicle
- Vehicle info to removepublic boolean registerUsage(VehicleModelInfo info, java.lang.String uid)
info
- Vehicle model infouid
- The UID of the object using itpublic boolean unregisterUsage(VehicleModelInfo info, java.lang.String uid)
info
- Vehicle model infouid
- UID of the object using itpublic void dispose()
public void rescan()