# Module `CleanUp`

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

It also prevents airplanes from firing within this area.

## Global(s)

CLEANUP |

## Type `CLEANUP`

CLEANUP.ClassName |
CLEANUP.CleanUpList |
CLEANUP:New(ZoneNames, TimeInterval) |
CLEANUP.TimeInterval |
CLEANUP.ZoneNames |
CLEANUP:_AddForCleanUp(CleanUpUnit, CleanUpUnitName) | Add the DCSUnit#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, CleanUpUnitName) | Destroys a DCSUnit#Unit from the simulator, but checks first if it is still existing!
CLEANUP:_EventAddForCleanUp(event, Event) | Detects if the Unit has an SEVENTENGINESHUTDOWN or an SEVENT_HIT within the given ZoneNames.
CLEANUP:_EventCrash(event, Event) | Detects if a crash event occurs.
CLEANUP:_EventHitCleanUp(event, Event) | Detects if the Unit has an SEVENTHIT within the given ZoneNames.
CLEANUP:_EventShot(event, Event) | Detects if a unit shoots a missile.
CLEANUP:_OnEventBirth(Event) |

## Global(s)

#CLEANUP CLEANUP

## Type `CleanUp`

The CLEANUP class.

### Field(s)

#string CLEANUP.ClassName

CLEANUP.CleanUpList

CLEANUP:New(ZoneNames, TimeInterval)

  ### Parameters

  - `ZoneNames` :

  - `TimeInterval` :

#number CLEANUP.TimeInterval

CLEANUP.ZoneNames

CLEANUP:_AddForCleanUp(CleanUpUnit, CleanUpUnitName)

  Add the DCSUnit#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

  - `DCSGroup#Group GroupObject` : The object to be destroyed.

  - `#string CleanUpGroupName` : The groupname...

CLEANUP:_DestroyMissile(MissileObject)

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

  ### Parameter

  - `MissileObject` :

CLEANUP:_DestroyUnit(CleanUpUnit, CleanUpUnitName)

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

  ### Parameters

  - `DCSUnit#Unit CleanUpUnit` : The object to be destroyed.

  - `#string CleanUpUnitName` : The Unit name ...

CLEANUP:_EventAddForCleanUp(event, Event)

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

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

  ### Parameters

  - `DCSTypes#Event event` :

  - `Event` :

CLEANUP:_EventCrash(event, Event)

  Detects if a crash event occurs.

  Crashed units go into a CleanUpList for removal.

  ### Parameters

  - `DCSTypes#Event event` :

  - `Event` :

CLEANUP:_EventHitCleanUp(event, Event)

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

  If this is the case, destroy the unit.

  ### Parameters

  - `DCSTypes#Event event` :

  - `Event` :

CLEANUP:_EventShot(event, Event)

  Detects if a unit shoots a missile.

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

  ### Parameters

  - `DCSTypes#Event event` :

  - `Event` :

CLEANUP:_OnEventBirth(Event)

  ### Parameter

  - `Event` :