Module Airbase

Wrapper -- AIRBASE is a wrapper class to handle the DCS Airbase objects.


Author: FlightControl

Contributions:


Global(s)

AIRBASE

AIRBASE class, extends Positionable#POSITIONABLE

AIRBASE is a wrapper class to handle the DCS Airbase objects:

  • Support all DCS Airbase APIs.

Type AIRBASE

AIRBASE.Caucasus

Enumeration to identify the airbases in the Caucasus region.

AIRBASE:Find(DCSAirbase)

Finds a AIRBASE from the _DATABASE using a DCSAirbase object.

AIRBASE:FindByName(AirbaseName)

Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.

AIRBASE:GetDCSObject()
AIRBASE:GetZone()

Get the airbase zone.

AIRBASE.Nevada
AIRBASE.Normandy
AIRBASE:Register(AirbaseName)

Create a new AIRBASE from DCSAirbase.

Global(s)

#AIRBASE AIRBASE

AIRBASE class, extends Positionable#POSITIONABLE

AIRBASE is a wrapper class to handle the DCS Airbase objects:

  • Support all DCS Airbase APIs.
  • Enhance with Airbase specific APIs not in the DCS Airbase API set.

AIRBASE reference methods

For each DCS Airbase object alive within a running mission, a AIRBASE wrapper object (instance) will be created within the _DATABASE object. This is done at the beginning of the mission (when the mission starts).

The AIRBASE class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference using the DCS Airbase or the DCS AirbaseName.

Another thing to know is that AIRBASE objects do not "contain" the DCS Airbase object. The AIRBASE methods will reference the DCS Airbase object by name when it is needed during API execution. If the DCS Airbase object does not exist or is nil, the AIRBASE methods will return nil and log an exception in the DCS.log file.

The AIRBASE class provides the following functions to retrieve quickly the relevant AIRBASE instance:

  • AIRBASE.Find(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase object.
  • AIRBASE.FindByName(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase name.

IMPORTANT: ONE SHOULD NEVER SANATIZE these AIRBASE OBJECT REFERENCES! (make the AIRBASE object references nil).

DCS Airbase APIs

The DCS Airbase APIs are used extensively within MOOSE. The AIRBASE class has for each DCS Airbase API a corresponding method. To be able to distinguish easily in your code the difference between a AIRBASE API call and a DCS Airbase API call, the first letter of the method is also capitalized. So, by example, the DCS Airbase method DCSWrapper.Airbase#Airbase.getName() is implemented in the AIRBASE class as AIRBASE.GetName().

Type Airbase

Type AIRBASE

Extends Wrapper.Positionable#POSITIONABLE

Field(s)

#table AIRBASE.Caucasus

Enumeration to identify the airbases in the Caucasus region.

These are all airbases of Caucasus:

  • AIRBASE.Caucasus.Gelendzhik
  • AIRBASE.Caucasus.Krasnodar_Pashkovsky
  • AIRBASE.Caucasus.Sukhumi_Babushara
  • AIRBASE.Caucasus.Gudauta
  • AIRBASE.Caucasus.Batumi
  • AIRBASE.Caucasus.Senaki_Kolkhi
  • AIRBASE.Caucasus.Kobuleti
  • AIRBASE.Caucasus.Kutaisi
  • AIRBASE.Caucasus.Tbilisi_Lochini
  • AIRBASE.Caucasus.Soganlug
  • AIRBASE.Caucasus.Vaziani
  • AIRBASE.Caucasus.Anapa_Vityazevo
  • AIRBASE.Caucasus.Krasnodar_Center
  • AIRBASE.Caucasus.Novorossiysk
  • AIRBASE.Caucasus.Krymsk
  • AIRBASE.Caucasus.Maykop_Khanskaya
  • AIRBASE.Caucasus.Sochi_Adler
  • AIRBASE.Caucasus.Mineralnye_Vody
  • AIRBASE.Caucasus.Nalchik
  • AIRBASE.Caucasus.Mozdok
  • AIRBASE.Caucasus.Beslan
AIRBASE:Find(DCSAirbase)

Finds a AIRBASE from the _DATABASE using a DCSAirbase object.

Parameter

Return value

Wrapper.Airbase#AIRBASE: self

AIRBASE:FindByName(AirbaseName)

Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.

Parameter

  • #string AirbaseName : The Airbase Name.

Return value

Wrapper.Airbase#AIRBASE: self

AIRBASE:GetDCSObject()
AIRBASE:GetZone()

Get the airbase zone.

Return value

Core.Zone#ZONE_RADIUS: The zone radius of the airbase.

#table AIRBASE.Nevada
#table AIRBASE.Normandy
AIRBASE:Register(AirbaseName)

Create a new AIRBASE from DCSAirbase.

Parameter

  • #string AirbaseName : The name of the airbase.

Return value

Wrapper.Airbase#AIRBASE: