Warehouse#
Warehouse gives control over the warehouses associated with airbase objects. A
warehouse limits which aircraft, munitions, and fuel are actually available to
coalition aircraft operating from that airbase. Warehouse does not extend any
other class documented here (the wiki notes a possible relationship to
Airbase, but does not document it further).
- class Warehouse#
Static functions#
- static getByName(name)#
Returns the
Warehouseassociated with the airbase of the given name.- Parameters:
name (
string) – Airbase name.- Returns:
The matching warehouse.
- Return type:
- static getResourceMap()#
Returns a table mapping resource (item/liquid) type names to their display names.
- Returns:
Resource map.
- Return type:
table
- static getCargoAsWarehouse(cargoStaticObject)#
Returns the
Warehouseview of a cargo-type static object, if applicable.- Parameters:
cargoStaticObject (
StaticObject) – A cargo-typeStaticObject.- Returns:
The corresponding warehouse.
- Return type:
Member functions#
- addItem(itemName, count)#
Adds
countof the named item (e.g. a weapon or aircraft type) to the warehouse’s inventory.- Parameters:
itemName (
string) – Item type name.count (
number) – Quantity to add.
- getItemCount(itemName)#
Returns the current quantity of the named item in the warehouse.
- Parameters:
itemName (
string) – Item type name.- Returns:
Current quantity.
- Return type:
number
- setItem(itemName, count)#
Sets the quantity of the named item in the warehouse, overriding the current value.
- Parameters:
itemName (
string) – Item type name.count (
number) – New quantity.
- removeItem(itemName, count)#
Removes
countof the named item from the warehouse’s inventory.Note
Not to be confused with
missionCommands.removeItem, an unrelated function on a different singleton.- Parameters:
itemName (
string) – Item type name.count (
number) – Quantity to remove.
- addLiquid(liquidType, amount)#
Adds
amountof the given liquid type (see liquid type table) to the warehouse.- Parameters:
liquidType (
number) – Liquid type.amount (
number) – Amount to add, in liters.
- getLiquidAmount(liquidType)#
Returns the current amount of the given liquid type in the warehouse.
- Parameters:
liquidType (
number) – Liquid type.- Returns:
Current amount, in liters.
- Return type:
number
- setLiquidAmount(liquidType, amount)#
Sets the amount of the given liquid type in the warehouse, overriding the current value.
- Parameters:
liquidType (
number) – Liquid type.amount (
number) – New amount, in liters.
- removeLiquid(liquidType, amount)#
Removes
amountof the given liquid type from the warehouse.- Parameters:
liquidType (
number) – Liquid type.amount (
number) – Amount to remove, in liters.
- getOwner()#
Returns the
Airbasethat owns this warehouse.- Returns:
The owning airbase.
- Return type:
- getInventory(itemNameFilter)#
Returns the warehouse’s full inventory, optionally filtered to item names matching
itemNameFilter.- Parameters:
itemNameFilter (
string) – Optional item name (or pattern) to filter by.- Returns:
Inventory table.
- Return type:
table
Enumerators#
Liquid type IDs used by the liquid-related member functions above:
Value |
Meaning |
|---|---|
|
Jet fuel |
|
Aviation gasoline |
|
MW50 (water/methanol) |
|
Diesel |
Footnotes#
A warehouse is typically obtained via
Airbase.getWarehouse()rather thanWarehouse.getByNamedirectly.Warehousewas added in DCS 2.8.8, considerably later than most other classes in the SSE.