Module CleanUp

Functional -- The CLEANUP class keeps an area clean of crashing or colliding airplanes.

It also prevents airplanes from firing within this area.

Banner Image


Author: Sven Van de Velde (FlightControl)

Contributions:


Global(s)

CLEANUP

CLEANUP, extends Base#BASE

The CLEANUP class keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.

Type CLEANUP

CLEANUP.<

string,Wrapper.Airbase#AIRBASE> Airbases Map of Airbases.

CLEANUP:AddAirbase(AirbaseName)

Adds an airbase to the airbase validation list.

CLEANUP.CleanUpScheduler
CLEANUP:IsInAirbase(Vec2)
CLEANUP:New(<, AirbaseNames)

Creates the main object which is handling the cleaning of the debris within the given Zone Names.

CLEANUP:OnEventBirth(EventData)
CLEANUP:OnEventCrash(event, Event)

Detects if a crash event occurs.

CLEANUP:OnEventHit(Event)

Detects if the Unit has an SEVENTHIT within the given AirbaseNames.

CLEANUP:OnEventShot(Event)

Detects if a unit shoots a missile.

CLEANUP:RemoveAirbase(AirbaseName)

Removes an airbase from the airbase validation list.

CLEANUP:_AddForCleanUp(CleanUpUnit, CleanUpUnitName)

Add the DCSWrapper.Unit#Unit to the CleanUpList for CleanUp.

CLEANUP:_CleanUpScheduler()

At the defined time interval, CleanUp the Groups within the CleanUpList.

CLEANUP:_DestroyGroup(GroupObject, CleanUpGroupName)

Destroys a group from the simulator, but checks first if it is still existing!

CLEANUP:_DestroyMissile(MissileObject)
CLEANUP:_DestroyUnit(CleanUpUnit)

Destroys a Unit from the simulator, but checks first if it is still existing!

CLEANUP:_EventAddForCleanUp(Event)

Detects if the Unit has an SEVENTENGINESHUTDOWN or an SEVENT_HIT within the given AirbaseNames.

Global(s)

#CLEANUP CLEANUP

CLEANUP, extends Base#BASE

The CLEANUP class keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.

Type CleanUp

Type CLEANUP

Field(s)

#map CLEANUP.<

string,Wrapper.Airbase#AIRBASE> Airbases Map of Airbases.

CLEANUP:AddAirbase(AirbaseName)

Adds an airbase to the airbase validation list.

Parameter

  • #string AirbaseName :

Return value

#CLEANUP:

CLEANUP.CleanUpScheduler
CLEANUP:IsInAirbase(Vec2)

Parameter

  • Vec2 :

CLEANUP:New(<, AirbaseNames)

Creates the main object which is handling the cleaning of the debris within the given Zone Names.

Parameters

  • #list < : string> AirbaseNames Is a table of airbase names where the debris should be cleaned. Also a single string can be passed with one airbase name.

  • AirbaseNames :

Return value

#CLEANUP:

Usage:

 -- Clean these Zones.
CleanUpAirports = CLEANUP:New( { AIRBASE.Caucasus.Tbilisi, AIRBASE.Caucasus.Kutaisi )
or
CleanUpTbilisi = CLEANUP:New( AIRBASE.Caucasus.Tbilisi )
CleanUpKutaisi = CLEANUP:New( AIRBASE.Caucasus.Kutaisi )
CLEANUP:OnEventBirth(EventData)

Parameter

CLEANUP:OnEventCrash(event, Event)

Detects if a crash event occurs.

Crashed units go into a CleanUpList for removal.

Parameters

CLEANUP:OnEventHit(Event)

Detects if the Unit has an SEVENTHIT within the given AirbaseNames.

If this is the case, destroy the unit.

Parameter

CLEANUP:OnEventShot(Event)

Detects if a unit shoots a missile.

If this occurs within one of the airbases, then the weapon used must be destroyed.

Parameter

CLEANUP:RemoveAirbase(AirbaseName)

Removes an airbase from the airbase validation list.

Parameter

  • #string AirbaseName :

Return value

#CLEANUP:

CLEANUP:_AddForCleanUp(CleanUpUnit, CleanUpUnitName)

Add the DCSWrapper.Unit#Unit to the CleanUpList for CleanUp.

Parameters

  • CleanUpUnit :

  • CleanUpUnitName :

CLEANUP:_CleanUpScheduler()

At the defined time interval, CleanUp the Groups within the CleanUpList.

CLEANUP:_DestroyGroup(GroupObject, CleanUpGroupName)

Destroys a group from the simulator, but checks first if it is still existing!

Parameters

CLEANUP:_DestroyMissile(MissileObject)

TODO check Dcs.DCSTypes#Weapon - Destroys a missile from the simulator, but checks first if it is still existing! @param #CLEANUP self @param Dcs.DCSTypes#Weapon MissileObject

Parameter

  • MissileObject :

CLEANUP:_DestroyUnit(CleanUpUnit)

Destroys a Unit from the simulator, but checks first if it is still existing!

Parameter

CLEANUP:_EventAddForCleanUp(Event)

Detects if the Unit has an SEVENTENGINESHUTDOWN or an SEVENT_HIT within the given AirbaseNames.

If this is the case, add the Group to the CLEANUP List.

Parameter

Type list

Type map