mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
New implementations
of inheritance of private - public methods .... This is a big improvement for many!
This commit is contained in:
parent
5d2eb2ea15
commit
8e5af4ada4
@ -201,6 +201,10 @@ BASE = {
|
|||||||
_ = {},
|
_ = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
--- @field #BASE.__
|
||||||
|
BASE.__ = {}
|
||||||
|
|
||||||
--- The Formation Class
|
--- The Formation Class
|
||||||
-- @type FORMATION
|
-- @type FORMATION
|
||||||
-- @field Cone A cone formation.
|
-- @field Cone A cone formation.
|
||||||
@ -224,47 +228,19 @@ FORMATION = {
|
|||||||
-- @return #BASE
|
-- @return #BASE
|
||||||
function BASE:New()
|
function BASE:New()
|
||||||
local self = routines.utils.deepCopy( self ) -- Create a new self instance
|
local self = routines.utils.deepCopy( self ) -- Create a new self instance
|
||||||
local MetaTable = {}
|
|
||||||
setmetatable( self, MetaTable )
|
|
||||||
self.__index = self
|
|
||||||
_ClassID = _ClassID + 1
|
_ClassID = _ClassID + 1
|
||||||
self.ClassID = _ClassID
|
self.ClassID = _ClassID
|
||||||
|
|
||||||
|
-- This is for "private" methods...
|
||||||
|
-- When a __ is passed to a method as "self", the __index will search for the method on the public method list too!
|
||||||
|
if self.__ then
|
||||||
|
setmetatable( self, { __index = self.__ } )
|
||||||
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function BASE:_Destructor()
|
|
||||||
--self:E("_Destructor")
|
|
||||||
|
|
||||||
--self:EventRemoveAll()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
-- THIS IS WHY WE NEED LUA 5.2 ...
|
|
||||||
function BASE:_SetDestructor()
|
|
||||||
|
|
||||||
-- TODO: Okay, this is really technical...
|
|
||||||
-- When you set a proxy to a table to catch __gc, weak tables don't behave like weak...
|
|
||||||
-- Therefore, I am parking this logic until I've properly discussed all this with the community.
|
|
||||||
|
|
||||||
local proxy = newproxy(true)
|
|
||||||
local proxyMeta = getmetatable(proxy)
|
|
||||||
|
|
||||||
proxyMeta.__gc = function ()
|
|
||||||
env.info("In __gc for " .. self:GetClassNameAndID() )
|
|
||||||
if self._Destructor then
|
|
||||||
self:_Destructor()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- keep the userdata from newproxy reachable until the object
|
|
||||||
-- table is about to be garbage-collected - then the __gc hook
|
|
||||||
-- will be invoked and the destructor called
|
|
||||||
rawset( self, '__proxy', proxy )
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
--- This is the worker method to inherit from a parent class.
|
--- This is the worker method to inherit from a parent class.
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param Child is the Child class that inherits.
|
-- @param Child is the Child class that inherits.
|
||||||
@ -272,11 +248,18 @@ end
|
|||||||
-- @return #BASE Child
|
-- @return #BASE Child
|
||||||
function BASE:Inherit( Child, Parent )
|
function BASE:Inherit( Child, Parent )
|
||||||
local Child = routines.utils.deepCopy( Child )
|
local Child = routines.utils.deepCopy( Child )
|
||||||
--local Parent = routines.utils.deepCopy( Parent )
|
|
||||||
--local Parent = Parent
|
|
||||||
if Child ~= nil then
|
if Child ~= nil then
|
||||||
setmetatable( Child, Parent )
|
|
||||||
Child.__index = Child
|
-- This is for "private" methods...
|
||||||
|
-- When a __ is passed to a method as "self", the __index will search for the method on the public method list of the same object too!
|
||||||
|
if Child.__ then
|
||||||
|
setmetatable( Child, { __index = Child.__ } )
|
||||||
|
setmetatable( Child.__, { __index = Parent } )
|
||||||
|
else
|
||||||
|
setmetatable( Child, { __index = Parent } )
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--Child:_SetDestructor()
|
--Child:_SetDestructor()
|
||||||
end
|
end
|
||||||
@ -895,3 +878,35 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--- old stuff
|
||||||
|
|
||||||
|
--function BASE:_Destructor()
|
||||||
|
-- --self:E("_Destructor")
|
||||||
|
--
|
||||||
|
-- --self:EventRemoveAll()
|
||||||
|
--end
|
||||||
|
|
||||||
|
|
||||||
|
-- THIS IS WHY WE NEED LUA 5.2 ...
|
||||||
|
--function BASE:_SetDestructor()
|
||||||
|
--
|
||||||
|
-- -- TODO: Okay, this is really technical...
|
||||||
|
-- -- When you set a proxy to a table to catch __gc, weak tables don't behave like weak...
|
||||||
|
-- -- Therefore, I am parking this logic until I've properly discussed all this with the community.
|
||||||
|
--
|
||||||
|
-- local proxy = newproxy(true)
|
||||||
|
-- local proxyMeta = getmetatable(proxy)
|
||||||
|
--
|
||||||
|
-- proxyMeta.__gc = function ()
|
||||||
|
-- env.info("In __gc for " .. self:GetClassNameAndID() )
|
||||||
|
-- if self._Destructor then
|
||||||
|
-- self:_Destructor()
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- -- keep the userdata from newproxy reachable until the object
|
||||||
|
-- -- table is about to be garbage-collected - then the __gc hook
|
||||||
|
-- -- will be invoked and the destructor called
|
||||||
|
-- rawset( self, '__proxy', proxy )
|
||||||
|
--
|
||||||
|
--end
|
||||||
@ -1,7 +1,5 @@
|
|||||||
--- **Functional** -- The CLEANUP class keeps an area clean of crashing or colliding airplanes. It also prevents airplanes from firing within this area.
|
--- **Functional** -- The CLEANUP class keeps an area clean of crashing or colliding airplanes. It also prevents airplanes from firing within this area.
|
||||||
--
|
--
|
||||||
-- 
|
|
||||||
--
|
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- ### Author: **Sven Van de Velde (FlightControl)**
|
-- ### Author: **Sven Van de Velde (FlightControl)**
|
||||||
@ -11,14 +9,57 @@
|
|||||||
--
|
--
|
||||||
-- @module CleanUp
|
-- @module CleanUp
|
||||||
|
|
||||||
|
--- @type CLEANUP.__
|
||||||
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
--- @type CLEANUP
|
--- @type CLEANUP
|
||||||
-- @extends Core.Base#BASE
|
-- @extends #CLEANUP.__
|
||||||
-- @field #map<#string,Wrapper.Airbase#AIRBASE> Airbases Map of Airbases.
|
-- @field #map<#string,Wrapper.Airbase#AIRBASE> Airbases Map of Airbases.
|
||||||
|
|
||||||
--- # CLEANUP, extends @{Base#BASE}
|
--- # CLEANUP, extends @{Base#BASE}
|
||||||
--
|
--
|
||||||
|
-- 
|
||||||
|
--
|
||||||
-- The CLEANUP class keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.
|
-- The CLEANUP class keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.
|
||||||
|
-- Specific airbases need to be provided that need to be guarded. Each airbase registered, will be guarded within a zone of 8 km around the airbase.
|
||||||
|
-- Any unit that fires a missile, or shoots within the zone of an airbase, will be monitored by CLEANUP.
|
||||||
|
-- Within the 8km zone, units cannot fire any missile, which prevents the airbase runway to receive missile or bomb hits.
|
||||||
|
-- Any airborne or ground unit that is on the runway below 30 meters (default value) will be automatically removed if it is damaged.
|
||||||
|
--
|
||||||
|
-- This is not a full 100% secure implementation. It is still possible that CLEANUP cannot prevent (in-time) to keep the airbase clean.
|
||||||
|
-- The following situations may happen that will still stop the runway of an airbase:
|
||||||
|
--
|
||||||
|
-- * A damaged unit is not removed on time when above the runway, and crashes on the runway.
|
||||||
|
-- * A bomb or missile is still able to dropped on the runway.
|
||||||
|
-- * Units collide on the airbase, and could not be removed on time.
|
||||||
|
--
|
||||||
|
-- When a unit is within the airbase zone and needs to be monitored,
|
||||||
|
-- its status will be checked every 0.25 seconds! This is required to ensure that the airbase is kept clean.
|
||||||
|
-- But as a result, there is more CPU overload.
|
||||||
|
--
|
||||||
|
-- So as an advise, I suggest you use the CLEANUP class with care:
|
||||||
|
--
|
||||||
|
-- * Only monitor airbases that really need to be monitored!
|
||||||
|
-- * Try not to monitor airbases that are likely to be invaded by enemy troops.
|
||||||
|
-- For these airbases, there is little use to keep them clean, as they will be invaded anyway...
|
||||||
|
--
|
||||||
|
-- By following the above guidelines, you can add airbase cleanup with acceptable CPU overhead.
|
||||||
|
--
|
||||||
|
-- ## 1. CLEANUP Constructor
|
||||||
|
--
|
||||||
|
-- Creates the main object which is preventing the airbase to get polluted with debris on the runway, which halts the airbase.
|
||||||
|
--
|
||||||
|
-- -- 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 )
|
||||||
|
--
|
||||||
|
-- ## 2. Add or Remove airbases
|
||||||
|
--
|
||||||
|
-- The method @{#CLEANUP.AddAirbase} to add an airbase to the cleanup validation process.
|
||||||
|
-- The method @{#CLEANUP.RemoveAirbase} removes an airbase from the cleanup validation process.
|
||||||
--
|
--
|
||||||
-- @field #CLEANUP
|
-- @field #CLEANUP
|
||||||
CLEANUP = {
|
CLEANUP = {
|
||||||
@ -28,6 +69,10 @@ CLEANUP = {
|
|||||||
Airbases = {},
|
Airbases = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
--- @field #CLEANUP.__
|
||||||
|
CLEANUP.__ = {}
|
||||||
|
|
||||||
--- Creates the main object which is handling the cleaning of the debris within the given Zone Names.
|
--- Creates the main object which is handling the cleaning of the debris within the given Zone Names.
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
-- @param #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.
|
-- @param #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.
|
||||||
@ -52,9 +97,9 @@ function CLEANUP:New( AirbaseNames )
|
|||||||
self:AddAirbase( AirbaseName )
|
self:AddAirbase( AirbaseName )
|
||||||
end
|
end
|
||||||
|
|
||||||
self:HandleEvent( EVENTS.Birth )
|
self:HandleEvent( EVENTS.Birth, self.__.OnEventBirth )
|
||||||
|
|
||||||
self.CleanUpScheduler = SCHEDULER:New( self, self._CleanUpScheduler, {}, 1, self.TimeInterval )
|
self.CleanUpScheduler = SCHEDULER:New( self, self.__.CleanUpScheduler, {}, 1, self.TimeInterval )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -81,7 +126,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function CLEANUP:IsInAirbase( Vec2 )
|
function CLEANUP.__:IsInAirbase( Vec2 )
|
||||||
|
|
||||||
local InAirbase = false
|
local InAirbase = false
|
||||||
for AirbaseName, Airbase in pairs( self.Airbases ) do
|
for AirbaseName, Airbase in pairs( self.Airbases ) do
|
||||||
@ -95,23 +140,12 @@ function CLEANUP:IsInAirbase( Vec2 )
|
|||||||
return InAirbase
|
return InAirbase
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Destroys a group from the simulator, but checks first if it is still existing!
|
|
||||||
-- @param #CLEANUP self
|
|
||||||
-- @param Dcs.DCSWrapper.Group#Group GroupObject The object to be destroyed.
|
|
||||||
-- @param #string CleanUpGroupName The groupname...
|
|
||||||
function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName )
|
|
||||||
self:F( { GroupObject, CleanUpGroupName } )
|
|
||||||
|
|
||||||
if GroupObject then -- and GroupObject:isExist() then
|
|
||||||
trigger.action.deactivateGroup(GroupObject)
|
|
||||||
self:T( { "GroupObject Destroyed", GroupObject } )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Destroys a @{Unit} from the simulator, but checks first if it is still existing!
|
--- Destroys a @{Unit} from the simulator, but checks first if it is still existing!
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
-- @param Wrapper.Unit#UNIT CleanUpUnit The object to be destroyed.
|
-- @param Wrapper.Unit#UNIT CleanUpUnit The object to be destroyed.
|
||||||
function CLEANUP:_DestroyUnit( CleanUpUnit )
|
function CLEANUP.__:DestroyUnit( CleanUpUnit )
|
||||||
self:F( { CleanUpUnit } )
|
self:F( { CleanUpUnit } )
|
||||||
|
|
||||||
if CleanUpUnit then
|
if CleanUpUnit then
|
||||||
@ -131,13 +165,14 @@ function CLEANUP:_DestroyUnit( CleanUpUnit )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO check Dcs.DCSTypes#Weapon
|
|
||||||
|
|
||||||
--- Destroys a missile from the simulator, but checks first if it is still existing!
|
--- Destroys a missile from the simulator, but checks first if it is still existing!
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
-- @param Dcs.DCSTypes#Weapon MissileObject
|
-- @param Dcs.DCSTypes#Weapon MissileObject
|
||||||
function CLEANUP:_DestroyMissile( MissileObject )
|
function CLEANUP.__:DestroyMissile( MissileObject )
|
||||||
self:F( { MissileObject } )
|
self:F( { MissileObject } )
|
||||||
|
|
||||||
if MissileObject and MissileObject:isExist() then
|
if MissileObject and MissileObject:isExist() then
|
||||||
MissileObject:destroy()
|
MissileObject:destroy()
|
||||||
self:T( "MissileObject Destroyed")
|
self:T( "MissileObject Destroyed")
|
||||||
@ -146,30 +181,31 @@ end
|
|||||||
|
|
||||||
--- @param #CLEANUP self
|
--- @param #CLEANUP self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function CLEANUP:OnEventBirth( EventData )
|
function CLEANUP.__:OnEventBirth( EventData )
|
||||||
self:F( { EventData } )
|
self:F( { EventData } )
|
||||||
|
|
||||||
self.CleanUpList[EventData.IniDCSUnitName] = {}
|
self.CleanUpList[EventData.IniDCSUnitName] = {}
|
||||||
self.CleanUpList[EventData.IniDCSUnitName].CleanUpUnit = EventData.IniDCSUnit
|
self.CleanUpList[EventData.IniDCSUnitName].CleanUpUnit = EventData.IniUnit
|
||||||
self.CleanUpList[EventData.IniDCSUnitName].CleanUpGroup = EventData.IniDCSGroup
|
self.CleanUpList[EventData.IniDCSUnitName].CleanUpGroup = EventData.IniGroup
|
||||||
self.CleanUpList[EventData.IniDCSUnitName].CleanUpGroupName = EventData.IniDCSGroupName
|
self.CleanUpList[EventData.IniDCSUnitName].CleanUpGroupName = EventData.IniDCSGroupName
|
||||||
self.CleanUpList[EventData.IniDCSUnitName].CleanUpUnitName = EventData.IniDCSUnitName
|
self.CleanUpList[EventData.IniDCSUnitName].CleanUpUnitName = EventData.IniDCSUnitName
|
||||||
|
|
||||||
self:HandleEvent( EVENTS.EngineShutdown , self._EventAddForCleanUp )
|
self:HandleEvent( EVENTS.EngineShutdown , self.__.EventAddForCleanUp )
|
||||||
self:HandleEvent( EVENTS.EngineStartup, self._EventAddForCleanUp )
|
self:HandleEvent( EVENTS.EngineStartup, self.__.EventAddForCleanUp )
|
||||||
self:HandleEvent( EVENTS.Hit, self._EventAddForCleanUp )
|
self:HandleEvent( EVENTS.Hit, self.__.EventAddForCleanUp )
|
||||||
self:HandleEvent( EVENTS.PilotDead, self.OnEventCrash )
|
self:HandleEvent( EVENTS.PilotDead, self.__.OnEventCrash )
|
||||||
self:HandleEvent( EVENTS.Dead, self.OnEventCrash )
|
self:HandleEvent( EVENTS.Dead, self.__.OnEventCrash )
|
||||||
self:HandleEvent( EVENTS.Crash, self.OnEventCrash )
|
self:HandleEvent( EVENTS.Crash, self.__.OnEventCrash )
|
||||||
self:HandleEvent( EVENTS.Shot, self.OnEventShot )
|
self:HandleEvent( EVENTS.Shot, self.__.OnEventShot )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Detects if a crash event occurs.
|
--- Detects if a crash event occurs.
|
||||||
-- Crashed units go into a CleanUpList for removal.
|
-- Crashed units go into a CleanUpList for removal.
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
-- @param Dcs.DCSTypes#Event event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function CLEANUP:OnEventCrash( Event )
|
function CLEANUP.__:OnEventCrash( Event )
|
||||||
self:F( { Event } )
|
self:F( { Event } )
|
||||||
|
|
||||||
--TODO: This stuff is not working due to a DCS bug. Burning units cannot be destroyed.
|
--TODO: This stuff is not working due to a DCS bug. Burning units cannot be destroyed.
|
||||||
@ -180,10 +216,10 @@ function CLEANUP:OnEventCrash( Event )
|
|||||||
-- self:T("after deactivateGroup")
|
-- self:T("after deactivateGroup")
|
||||||
-- event.initiator:destroy()
|
-- event.initiator:destroy()
|
||||||
|
|
||||||
if Event.IniDCSUnitName then
|
if Event.IniDCSUnitName and Event.IniCategory == Object.Category.UNIT then
|
||||||
self.CleanUpList[Event.IniDCSUnitName] = {}
|
self.CleanUpList[Event.IniDCSUnitName] = {}
|
||||||
self.CleanUpList[Event.IniDCSUnitName].CleanUpUnit = Event.IniDCSUnit
|
self.CleanUpList[Event.IniDCSUnitName].CleanUpUnit = Event.IniUnit
|
||||||
self.CleanUpList[Event.IniDCSUnitName].CleanUpGroup = Event.IniDCSGroup
|
self.CleanUpList[Event.IniDCSUnitName].CleanUpGroup = Event.IniGroup
|
||||||
self.CleanUpList[Event.IniDCSUnitName].CleanUpGroupName = Event.IniDCSGroupName
|
self.CleanUpList[Event.IniDCSUnitName].CleanUpGroupName = Event.IniDCSGroupName
|
||||||
self.CleanUpList[Event.IniDCSUnitName].CleanUpUnitName = Event.IniDCSUnitName
|
self.CleanUpList[Event.IniDCSUnitName].CleanUpUnitName = Event.IniDCSUnitName
|
||||||
end
|
end
|
||||||
@ -194,79 +230,85 @@ end
|
|||||||
-- If this occurs within one of the airbases, then the weapon used must be destroyed.
|
-- If this occurs within one of the airbases, then the weapon used must be destroyed.
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
-- @param Core.Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function CLEANUP:OnEventShot( Event )
|
function CLEANUP.__:OnEventShot( Event )
|
||||||
self:F( { Event } )
|
self:F( { Event } )
|
||||||
|
|
||||||
-- Test if the missile was fired within one of the CLEANUP.AirbaseNames.
|
-- Test if the missile was fired within one of the CLEANUP.AirbaseNames.
|
||||||
if self:IsInAirbase( Event.IniUnit:GetVec2() ) then
|
if self:IsInAirbase( Event.IniUnit:GetVec2() ) then
|
||||||
-- Okay, the missile was fired within the CLEANUP.AirbaseNames, destroy the fired weapon.
|
-- Okay, the missile was fired within the CLEANUP.AirbaseNames, destroy the fired weapon.
|
||||||
self:_DestroyMissile( Event.Weapon )
|
self:DestroyMissile( Event.Weapon )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Detects if the Unit has an S_EVENT_HIT within the given AirbaseNames. If this is the case, destroy the unit.
|
--- Detects if the Unit has an S_EVENT_HIT within the given AirbaseNames. If this is the case, destroy the unit.
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
-- @param Core.Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function CLEANUP:OnEventHit( Event )
|
function CLEANUP.__:OnEventHit( Event )
|
||||||
self:F( { Event } )
|
self:F( { Event } )
|
||||||
|
|
||||||
if Event.IniUnit then
|
if Event.IniUnit then
|
||||||
if self:IsInAirbase( Event.IniUnit:GetVec2() ) then
|
if self:IsInAirbase( Event.IniUnit:GetVec2() ) then
|
||||||
self:T( { "Life: ", Event.IniDCSUnitName, ' = ', Event.IniDCSUnit:getLife(), "/", Event.IniDCSUnit:getLife0() } )
|
self:T( { "Life: ", Event.IniDCSUnitName, ' = ', Event.IniUnit:GetLife(), "/", Event.IniUnit:GetLife0() } )
|
||||||
if Event.IniDCSUnit:getLife() < Event.IniDCSUnit:getLife0() then
|
if Event.IniUnit:GetLife() < Event.IniUnit:GetLife0() then
|
||||||
self:T( "CleanUp: Destroy: " .. Event.IniDCSUnitName )
|
self:T( "CleanUp: Destroy: " .. Event.IniDCSUnitName )
|
||||||
CLEANUP:_DestroyUnit( Event.IniUnit )
|
CLEANUP.__:DestroyUnit( Event.IniUnit )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if Event.TgtUnit then
|
if Event.TgtUnit then
|
||||||
if self:IsInAirbase( Event.TgtUnit:GetVec2() ) then
|
if self:IsInAirbase( Event.TgtUnit:GetVec2() ) then
|
||||||
self:T( { "Life: ", Event.TgtDCSUnitName, ' = ', Event.TgtDCSUnit:getLife(), "/", Event.TgtDCSUnit:getLife0() } )
|
self:T( { "Life: ", Event.TgtDCSUnitName, ' = ', Event.TgtUnit:GetLife(), "/", Event.TgtUnit:GetLife0() } )
|
||||||
if Event.TgtDCSUnit:getLife() < Event.TgtDCSUnit:getLife0() then
|
if Event.TgtUnit:GetLife() < Event.TgtUnit:GetLife0() then
|
||||||
self:T( "CleanUp: Destroy: " .. Event.TgtDCSUnitName )
|
self:T( "CleanUp: Destroy: " .. Event.TgtDCSUnitName )
|
||||||
CLEANUP:_DestroyUnit( Event.TgtUnit )
|
CLEANUP.__:DestroyUnit( Event.TgtUnit )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Add the @{DCSWrapper.Unit#Unit} to the CleanUpList for CleanUp.
|
--- Add the @{DCSWrapper.Unit#Unit} to the CleanUpList for CleanUp.
|
||||||
function CLEANUP:_AddForCleanUp( CleanUpUnit, CleanUpUnitName )
|
-- @param #CLEANUP self
|
||||||
|
-- @param Wrapper.Unit#UNIT CleanUpUnit
|
||||||
|
-- @oaram #string CleanUpUnitName
|
||||||
|
function CLEANUP.__:AddForCleanUp( CleanUpUnit, CleanUpUnitName )
|
||||||
self:F( { CleanUpUnit, CleanUpUnitName } )
|
self:F( { CleanUpUnit, CleanUpUnitName } )
|
||||||
|
|
||||||
self.CleanUpList[CleanUpUnitName] = {}
|
self.CleanUpList[CleanUpUnitName] = {}
|
||||||
self.CleanUpList[CleanUpUnitName].CleanUpUnit = CleanUpUnit
|
self.CleanUpList[CleanUpUnitName].CleanUpUnit = CleanUpUnit
|
||||||
self.CleanUpList[CleanUpUnitName].CleanUpUnitName = CleanUpUnitName
|
self.CleanUpList[CleanUpUnitName].CleanUpUnitName = CleanUpUnitName
|
||||||
self.CleanUpList[CleanUpUnitName].CleanUpGroup = Unit.getGroup(CleanUpUnit)
|
|
||||||
self.CleanUpList[CleanUpUnitName].CleanUpGroupName = Unit.getGroup(CleanUpUnit):getName()
|
local CleanUpGroup = CleanUpUnit:GetGroup()
|
||||||
|
|
||||||
|
self.CleanUpList[CleanUpUnitName].CleanUpGroup = CleanUpGroup
|
||||||
|
self.CleanUpList[CleanUpUnitName].CleanUpGroupName = CleanUpGroup:GetName()
|
||||||
self.CleanUpList[CleanUpUnitName].CleanUpTime = timer.getTime()
|
self.CleanUpList[CleanUpUnitName].CleanUpTime = timer.getTime()
|
||||||
self.CleanUpList[CleanUpUnitName].CleanUpMoved = false
|
self.CleanUpList[CleanUpUnitName].CleanUpMoved = false
|
||||||
|
|
||||||
self:T( { "CleanUp: Add to CleanUpList: ", Unit.getGroup(CleanUpUnit):getName(), CleanUpUnitName } )
|
self:T( { "CleanUp: Add to CleanUpList: ", CleanUpGroup:GetName(), CleanUpUnitName } )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Detects if the Unit has an S_EVENT_ENGINE_SHUTDOWN or an S_EVENT_HIT within the given AirbaseNames. If this is the case, add the Group to the CLEANUP List.
|
--- Detects if the Unit has an S_EVENT_ENGINE_SHUTDOWN or an S_EVENT_HIT within the given AirbaseNames. If this is the case, add the Group to the CLEANUP List.
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP.__ self
|
||||||
-- @param Core.Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function CLEANUP:_EventAddForCleanUp( Event )
|
function CLEANUP.__:EventAddForCleanUp( Event )
|
||||||
|
|
||||||
self:F({Event})
|
self:F({Event})
|
||||||
|
|
||||||
if Event.IniDCSUnit then
|
|
||||||
|
if Event.IniDCSUnit and Event.IniCategory == Object.Category.UNIT then
|
||||||
if self.CleanUpList[Event.IniDCSUnitName] == nil then
|
if self.CleanUpList[Event.IniDCSUnitName] == nil then
|
||||||
if self:IsInAirbase( Event.IniUnit:GetVec2() ) then
|
if self:IsInAirbase( Event.IniUnit:GetVec2() ) then
|
||||||
self:_AddForCleanUp( Event.IniDCSUnit, Event.IniDCSUnitName )
|
self:AddForCleanUp( Event.IniUnit, Event.IniDCSUnitName )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if Event.TgtDCSUnit then
|
if Event.TgtDCSUnit and Event.TgtCategory == Object.Category.UNIT then
|
||||||
if self.CleanUpList[Event.TgtDCSUnitName] == nil then
|
if self.CleanUpList[Event.TgtDCSUnitName] == nil then
|
||||||
if self:IsInAirbase( Event.TgtUnit:GetVec2() ) then
|
if self:IsInAirbase( Event.TgtUnit:GetVec2() ) then
|
||||||
self:_AddForCleanUp( Event.TgtDCSUnit, Event.TgtDCSUnitName )
|
self:AddForCleanUp( Event.TgtUnit, Event.TgtDCSUnitName )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -276,23 +318,23 @@ end
|
|||||||
|
|
||||||
--- At the defined time interval, CleanUp the Groups within the CleanUpList.
|
--- At the defined time interval, CleanUp the Groups within the CleanUpList.
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
function CLEANUP:_CleanUpScheduler()
|
function CLEANUP.__:CleanUpScheduler()
|
||||||
|
|
||||||
local CleanUpCount = 0
|
local CleanUpCount = 0
|
||||||
for CleanUpUnitName, UnitData in pairs( self.CleanUpList ) do
|
for CleanUpUnitName, CleanUpListData in pairs( self.CleanUpList ) do
|
||||||
CleanUpCount = CleanUpCount + 1
|
CleanUpCount = CleanUpCount + 1
|
||||||
|
|
||||||
local CleanUpUnit = UNIT:FindByName( CleanUpUnitName )
|
local CleanUpUnit = CleanUpListData.CleanUpUnit -- Wrapper.Unit#UNIT
|
||||||
local CleanUpDCSUnit = Unit.getByName( CleanUpUnitName )
|
local CleanUpGroupName = CleanUpListData.CleanUpGroupName
|
||||||
local CleanUpGroupName = UnitData.CleanUpGroupName
|
|
||||||
|
|
||||||
if CleanUpUnit then
|
if CleanUpUnit:IsAlive() ~= nil then
|
||||||
|
|
||||||
if _DATABASE:GetStatusGroup( CleanUpGroupName ) ~= "ReSpawn" then
|
if _DATABASE:GetStatusGroup( CleanUpGroupName ) ~= "ReSpawn" then
|
||||||
|
|
||||||
local CleanUpCoordinate = CleanUpUnit:GetCoordinate()
|
local CleanUpCoordinate = CleanUpUnit:GetCoordinate()
|
||||||
|
|
||||||
if CleanUpDCSUnit and CleanUpDCSUnit:getLife() <= CleanUpDCSUnit:getLife0() * 0.95 then
|
self:T( { "CleanUp Scheduler", CleanUpUnitName } )
|
||||||
|
if CleanUpUnit:GetLife() <= CleanUpUnit:GetLife0() * 0.95 then
|
||||||
if CleanUpUnit:IsAboveRunway() then
|
if CleanUpUnit:IsAboveRunway() then
|
||||||
if CleanUpUnit:InAir() then
|
if CleanUpUnit:InAir() then
|
||||||
|
|
||||||
@ -301,11 +343,11 @@ function CLEANUP:_CleanUpScheduler()
|
|||||||
|
|
||||||
if CleanUpUnitHeight < 30 then
|
if CleanUpUnitHeight < 30 then
|
||||||
self:T( { "CleanUp Scheduler", "Destroy " .. CleanUpUnitName .. " because below safe height and damaged." } )
|
self:T( { "CleanUp Scheduler", "Destroy " .. CleanUpUnitName .. " because below safe height and damaged." } )
|
||||||
self:_DestroyUnit( CleanUpUnit )
|
self:DestroyUnit( CleanUpUnit )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:T( { "CleanUp Scheduler", "Destroy " .. CleanUpUnitName .. " because on runway and damaged." } )
|
self:T( { "CleanUp Scheduler", "Destroy " .. CleanUpUnitName .. " because on runway and damaged." } )
|
||||||
self:_DestroyUnit(CleanUpUnit )
|
self:DestroyUnit( CleanUpUnit )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -313,15 +355,15 @@ function CLEANUP:_CleanUpScheduler()
|
|||||||
if CleanUpUnit then
|
if CleanUpUnit then
|
||||||
local CleanUpUnitVelocity = CleanUpUnit:GetVelocityKMH()
|
local CleanUpUnitVelocity = CleanUpUnit:GetVelocityKMH()
|
||||||
if CleanUpUnitVelocity < 1 then
|
if CleanUpUnitVelocity < 1 then
|
||||||
if UnitData.CleanUpMoved then
|
if CleanUpListData.CleanUpMoved then
|
||||||
if UnitData.CleanUpTime + 180 <= timer.getTime() then
|
if CleanUpListData.CleanUpTime + 180 <= timer.getTime() then
|
||||||
self:T( { "CleanUp Scheduler", "Destroy due to not moving anymore " .. CleanUpUnitName } )
|
self:T( { "CleanUp Scheduler", "Destroy due to not moving anymore " .. CleanUpUnitName } )
|
||||||
self:_DestroyUnit( CleanUpUnit )
|
self:DestroyUnit( CleanUpUnit )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
UnitData.CleanUpTime = timer.getTime()
|
CleanUpListData.CleanUpTime = timer.getTime()
|
||||||
UnitData.CleanUpMoved = true
|
CleanUpListData.CleanUpMoved = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -365,7 +365,6 @@ end
|
|||||||
--- Returns the POSITIONABLE velocity in km/h.
|
--- Returns the POSITIONABLE velocity in km/h.
|
||||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return #number The velocity in km/h
|
-- @return #number The velocity in km/h
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
||||||
function POSITIONABLE:GetVelocityKMH()
|
function POSITIONABLE:GetVelocityKMH()
|
||||||
self:F2( self.PositionableName )
|
self:F2( self.PositionableName )
|
||||||
|
|
||||||
@ -379,13 +378,12 @@ function POSITIONABLE:GetVelocityKMH()
|
|||||||
return Velocity
|
return Velocity
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the POSITIONABLE velocity in meters per second.
|
--- Returns the POSITIONABLE velocity in meters per second.
|
||||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return #number The velocity in meters per second.
|
-- @return #number The velocity in meters per second.
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
||||||
function POSITIONABLE:GetVelocityMPS()
|
function POSITIONABLE:GetVelocityMPS()
|
||||||
self:F2( self.PositionableName )
|
self:F2( self.PositionableName )
|
||||||
|
|
||||||
@ -398,7 +396,7 @@ function POSITIONABLE:GetVelocityMPS()
|
|||||||
return Velocity
|
return Velocity
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -536,7 +536,7 @@ function UNIT:GetLife()
|
|||||||
return UnitLife
|
return UnitLife
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the Unit's initial health.
|
--- Returns the Unit's initial health.
|
||||||
@ -553,7 +553,7 @@ function UNIT:GetLife0()
|
|||||||
return UnitLife0
|
return UnitLife0
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the category name of the #UNIT.
|
--- Returns the category name of the #UNIT.
|
||||||
|
|||||||
@ -575,6 +575,7 @@
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
|
<em>#number</em>
|
||||||
<a id="#(AI_A2A).IdleCount" >
|
<a id="#(AI_A2A).IdleCount" >
|
||||||
<strong>AI_A2A.IdleCount</strong>
|
<strong>AI_A2A.IdleCount</strong>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -472,30 +472,24 @@ When Moose is loaded statically, (as one file), tracing is switched off by defau
|
|||||||
<td class="name" nowrap="nowrap"><a href="##(BASE).UnHandleEvent">BASE:UnHandleEvent(Event)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(BASE).UnHandleEvent">BASE:UnHandleEvent(Event)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
<p>UnSubscribe to a DCS event.</p>
|
<p>UnSubscribe to a DCS event.</p>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(BASE)._Destructor">BASE:_Destructor()</a></td>
|
|
||||||
<td class="summary">
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(BASE)._F">BASE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(BASE)._F">BASE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
<p>Trace a function call.</p>
|
<p>Trace a function call.</p>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(BASE)._SetDestructor">BASE:_SetDestructor()</a></td>
|
|
||||||
<td class="summary">
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(BASE)._T">BASE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(BASE)._T">BASE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
<p>Trace a function logic.</p>
|
<p>Trace a function logic.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(BASE).__">BASE.__</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -2134,19 +2128,6 @@ BASE:TraceOnOff( false )</code></pre>
|
|||||||
<p><em><a href="##(BASE)">#BASE</a>:</em></p>
|
<p><em><a href="##(BASE)">#BASE</a>:</em></p>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<a id="#(BASE)._Destructor" >
|
|
||||||
<strong>BASE:_Destructor()</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
@ -2187,22 +2168,6 @@ A #table or any field.</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<a id="#(BASE)._SetDestructor" >
|
|
||||||
<strong>BASE:_SetDestructor()</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p> THIS IS WHY WE NEED LUA 5.2 ...</p>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<a id="#(BASE)._T" >
|
<a id="#(BASE)._T" >
|
||||||
<strong>BASE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)</strong>
|
<strong>BASE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)</strong>
|
||||||
</a>
|
</a>
|
||||||
@ -2230,6 +2195,20 @@ A #table or any field.</p>
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<em><a href="##(BASE.__)">#BASE.__</a></em>
|
||||||
|
<a id="#(BASE).__" >
|
||||||
|
<strong>BASE.__</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
@ -2260,6 +2239,8 @@ A #table or any field.</p>
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
<h2><a id="#(BASE.__)" >Type <code>BASE.__</code></a></h2>
|
||||||
|
|
||||||
<h2><a id="#(FORMATION)" >Type <code>FORMATION</code></a></h2>
|
<h2><a id="#(FORMATION)" >Type <code>FORMATION</code></a></h2>
|
||||||
|
|
||||||
<p>The Formation Class</p>
|
<p>The Formation Class</p>
|
||||||
|
|||||||
@ -2934,7 +2934,6 @@ The range till cargo will board.</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em></em>
|
|
||||||
<a id="#(CARGO_UNIT).CargoCarrier" >
|
<a id="#(CARGO_UNIT).CargoCarrier" >
|
||||||
<strong>CARGO_UNIT.CargoCarrier</strong>
|
<strong>CARGO_UNIT.CargoCarrier</strong>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -110,8 +110,6 @@
|
|||||||
|
|
||||||
<p>It also prevents airplanes from firing within this area.</p>
|
<p>It also prevents airplanes from firing within this area.</p>
|
||||||
|
|
||||||
<p><img src="..\Presentations\CLEANUP\Dia1.JPG" alt="Banner Image"/></p>
|
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
<h3>Author: <strong>Sven Van de Velde (FlightControl)</strong></h3>
|
<h3>Author: <strong>Sven Van de Velde (FlightControl)</strong></h3>
|
||||||
@ -127,8 +125,9 @@
|
|||||||
<td class="summary">
|
<td class="summary">
|
||||||
<h1>CLEANUP, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
<h1>CLEANUP, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||||
|
|
||||||
<p>The CLEANUP class keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.</p>
|
<p><img src="..\Presentations\CLEANUP\Dia1.JPG" alt="Banner Image"/></p>
|
||||||
|
|
||||||
|
<p>The CLEANUP class keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -150,42 +149,12 @@
|
|||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).CleanUpScheduler">CLEANUP.CleanUpScheduler</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).CleanUpScheduler">CLEANUP.CleanUpScheduler</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).IsInAirbase">CLEANUP:IsInAirbase(Vec2)</a></td>
|
|
||||||
<td class="summary">
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).New">CLEANUP:New(<, AirbaseNames)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).New">CLEANUP:New(<, AirbaseNames)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
<p>Creates the main object which is handling the cleaning of the debris within the given Zone Names.</p>
|
<p>Creates the main object which is handling the cleaning of the debris within the given Zone Names.</p>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).OnEventBirth">CLEANUP:OnEventBirth(EventData)</a></td>
|
|
||||||
<td class="summary">
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).OnEventCrash">CLEANUP:OnEventCrash(event, Event)</a></td>
|
|
||||||
<td class="summary">
|
|
||||||
<p>Detects if a crash event occurs.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).OnEventHit">CLEANUP:OnEventHit(Event)</a></td>
|
|
||||||
<td class="summary">
|
|
||||||
<p>Detects if the Unit has an S<em>EVENT</em>HIT within the given AirbaseNames.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).OnEventShot">CLEANUP:OnEventShot(Event)</a></td>
|
|
||||||
<td class="summary">
|
|
||||||
<p>Detects if a unit shoots a missile.</p>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -195,39 +164,73 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP)._AddForCleanUp">CLEANUP:_AddForCleanUp(CleanUpUnit, CleanUpUnitName)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP).__">CLEANUP.__</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h2><a id="#(CLEANUP.__)">Type <code>CLEANUP.__</code></a></h2>
|
||||||
|
<table class="function_list">
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).AddForCleanUp">CLEANUP.__:AddForCleanUp(CleanUpUnit, CleanUpUnitName)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
<p>Add the <a href="DCSWrapper.Unit.html##(Unit)">DCSWrapper.Unit#Unit</a> to the CleanUpList for CleanUp.</p>
|
<p>Add the <a href="DCSWrapper.Unit.html##(Unit)">DCSWrapper.Unit#Unit</a> to the CleanUpList for CleanUp.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP)._CleanUpScheduler">CLEANUP:_CleanUpScheduler()</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).CleanUpScheduler">CLEANUP.__:CleanUpScheduler()</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
<p>At the defined time interval, CleanUp the Groups within the CleanUpList.</p>
|
<p>At the defined time interval, CleanUp the Groups within the CleanUpList.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP)._DestroyGroup">CLEANUP:_DestroyGroup(GroupObject, CleanUpGroupName)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).DestroyMissile">CLEANUP.__:DestroyMissile(MissileObject)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
<p>Destroys a group from the simulator, but checks first if it is still existing!</p>
|
<p>Destroys a missile from the simulator, but checks first if it is still existing!</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP)._DestroyMissile">CLEANUP:_DestroyMissile(MissileObject)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).DestroyUnit">CLEANUP.__:DestroyUnit(CleanUpUnit)</a></td>
|
||||||
<td class="summary">
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP)._DestroyUnit">CLEANUP:_DestroyUnit(CleanUpUnit)</a></td>
|
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
<p>Destroys a <a href="Unit.html">Unit</a> from the simulator, but checks first if it is still existing!</p>
|
<p>Destroys a <a href="Unit.html">Unit</a> from the simulator, but checks first if it is still existing!</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(CLEANUP)._EventAddForCleanUp">CLEANUP:_EventAddForCleanUp(Event)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).EventAddForCleanUp">CLEANUP.__:EventAddForCleanUp(Event)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
<p>Detects if the Unit has an S<em>EVENT</em>ENGINE<em>SHUTDOWN or an S</em>EVENT_HIT within the given AirbaseNames.</p>
|
<p>Detects if the Unit has an S<em>EVENT</em>ENGINE<em>SHUTDOWN or an S</em>EVENT_HIT within the given AirbaseNames.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).IsInAirbase">CLEANUP.__:IsInAirbase(Vec2)</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).OnEventBirth">CLEANUP.__:OnEventBirth(EventData)</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).OnEventCrash">CLEANUP.__:OnEventCrash(Event)</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
<p>Detects if a crash event occurs.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).OnEventHit">CLEANUP.__:OnEventHit(Event)</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
<p>Detects if the Unit has an S<em>EVENT</em>HIT within the given AirbaseNames.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(CLEANUP.__).OnEventShot">CLEANUP.__:OnEventShot(Event)</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
<p>Detects if a unit shoots a missile.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -245,8 +248,56 @@
|
|||||||
|
|
||||||
<h1>CLEANUP, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
<h1>CLEANUP, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||||
|
|
||||||
|
<p><img src="..\Presentations\CLEANUP\Dia1.JPG" alt="Banner Image"/></p>
|
||||||
|
|
||||||
<p>The CLEANUP class keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.</p>
|
<p>The CLEANUP class keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p>Specific airbases need to be provided that need to be guarded. Each airbase registered, will be guarded within a zone of 8 km around the airbase.
|
||||||
|
Any unit that fires a missile, or shoots within the zone of an airbase, will be monitored by CLEANUP.
|
||||||
|
Within the 8km zone, units cannot fire any missile, which prevents the airbase runway to receive missile or bomb hits.
|
||||||
|
Any airborne or ground unit that is on the runway below 30 meters (default value) will be automatically removed if it is damaged.</p>
|
||||||
|
|
||||||
|
<p>This is not a full 100% secure implementation. It is still possible that CLEANUP cannot prevent (in-time) to keep the airbase clean.
|
||||||
|
The following situations may happen that will still stop the runway of an airbase:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>A damaged unit is not removed on time when above the runway, and crashes on the runway.</li>
|
||||||
|
<li>A bomb or missile is still able to dropped on the runway.</li>
|
||||||
|
<li>Units collide on the airbase, and could not be removed on time.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>When a unit is within the airbase zone and needs to be monitored,
|
||||||
|
its status will be checked every 0.25 seconds! This is required to ensure that the airbase is kept clean.
|
||||||
|
But as a result, there is more CPU overload.</p>
|
||||||
|
|
||||||
|
<p>So as an advise, I suggest you use the CLEANUP class with care:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Only monitor airbases that really need to be monitored!</li>
|
||||||
|
<li>Try not to monitor airbases that are likely to be invaded by enemy troops.
|
||||||
|
For these airbases, there is little use to keep them clean, as they will be invaded anyway...</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>By following the above guidelines, you can add airbase cleanup with acceptable CPU overhead.</p>
|
||||||
|
|
||||||
|
<h2>1. CLEANUP Constructor</h2>
|
||||||
|
|
||||||
|
<p>Creates the main object which is preventing the airbase to get polluted with debris on the runway, which halts the airbase.</p>
|
||||||
|
|
||||||
|
<pre><code> -- 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 )
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h2>2. Add or Remove airbases</h2>
|
||||||
|
|
||||||
|
<p>The method <a href="##(CLEANUP).AddAirbase">CLEANUP.AddAirbase</a> to add an airbase to the cleanup validation process.
|
||||||
|
The method <a href="##(CLEANUP).RemoveAirbase">CLEANUP.RemoveAirbase</a> removes an airbase from the cleanup validation process.</p>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
@ -306,27 +357,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<a id="#(CLEANUP).IsInAirbase" >
|
|
||||||
<strong>CLEANUP:IsInAirbase(Vec2)</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3>Parameter</h3>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><code><em> Vec2 </em></code>: </p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
@ -371,104 +401,6 @@ CleanUpKutaisi = CLEANUP:New( AIRBASE.Caucasus.Kutaisi )</code></pre>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<a id="#(CLEANUP).OnEventBirth" >
|
|
||||||
<strong>CLEANUP:OnEventBirth(EventData)</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3>Parameter</h3>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> EventData </em></code>: </p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<a id="#(CLEANUP).OnEventCrash" >
|
|
||||||
<strong>CLEANUP:OnEventCrash(event, Event)</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
<p>Detects if a crash event occurs.</p>
|
|
||||||
|
|
||||||
|
|
||||||
<p>Crashed units go into a CleanUpList for removal.</p>
|
|
||||||
|
|
||||||
<h3>Parameters</h3>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><code><em><a href="Dcs.DCSTypes.html##(Event)">Dcs.DCSTypes#Event</a> event </em></code>: </p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><code><em> Event </em></code>: </p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<a id="#(CLEANUP).OnEventHit" >
|
|
||||||
<strong>CLEANUP:OnEventHit(Event)</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
<p>Detects if the Unit has an S<em>EVENT</em>HIT within the given AirbaseNames.</p>
|
|
||||||
|
|
||||||
|
|
||||||
<p>If this is the case, destroy the unit.</p>
|
|
||||||
|
|
||||||
<h3>Parameter</h3>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> Event </em></code>: </p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<a id="#(CLEANUP).OnEventShot" >
|
|
||||||
<strong>CLEANUP:OnEventShot(Event)</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
<p>Detects if a unit shoots a missile.</p>
|
|
||||||
|
|
||||||
|
|
||||||
<p>If this occurs within one of the airbases, then the weapon used must be destroyed.</p>
|
|
||||||
|
|
||||||
<h3>Parameter</h3>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> Event </em></code>: </p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<a id="#(CLEANUP).RemoveAirbase" >
|
<a id="#(CLEANUP).RemoveAirbase" >
|
||||||
<strong>CLEANUP:RemoveAirbase(AirbaseName)</strong>
|
<strong>CLEANUP:RemoveAirbase(AirbaseName)</strong>
|
||||||
</a>
|
</a>
|
||||||
@ -495,8 +427,25 @@ CleanUpKutaisi = CLEANUP:New( AIRBASE.Caucasus.Kutaisi )</code></pre>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<a id="#(CLEANUP)._AddForCleanUp" >
|
<em><a href="##(CLEANUP.__)">#CLEANUP.__</a></em>
|
||||||
<strong>CLEANUP:_AddForCleanUp(CleanUpUnit, CleanUpUnitName)</strong>
|
<a id="#(CLEANUP).__" >
|
||||||
|
<strong>CLEANUP.__</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<h2><a id="#(CLEANUP.__)" >Type <code>CLEANUP.__</code></a></h2>
|
||||||
|
<h3>Field(s)</h3>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<a id="#(CLEANUP.__).AddForCleanUp" >
|
||||||
|
<strong>CLEANUP.__:AddForCleanUp(CleanUpUnit, CleanUpUnitName)</strong>
|
||||||
</a>
|
</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@ -507,7 +456,7 @@ CleanUpKutaisi = CLEANUP:New( AIRBASE.Caucasus.Kutaisi )</code></pre>
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
||||||
<p><code><em> CleanUpUnit </em></code>: </p>
|
<p><code><em><a href="Wrapper.Unit.html##(UNIT)">Wrapper.Unit#UNIT</a> CleanUpUnit </em></code>: </p>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -521,8 +470,8 @@ CleanUpKutaisi = CLEANUP:New( AIRBASE.Caucasus.Kutaisi )</code></pre>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<a id="#(CLEANUP)._CleanUpScheduler" >
|
<a id="#(CLEANUP.__).CleanUpScheduler" >
|
||||||
<strong>CLEANUP:_CleanUpScheduler()</strong>
|
<strong>CLEANUP.__:CleanUpScheduler()</strong>
|
||||||
</a>
|
</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@ -534,53 +483,19 @@ CleanUpKutaisi = CLEANUP:New( AIRBASE.Caucasus.Kutaisi )</code></pre>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<a id="#(CLEANUP)._DestroyGroup" >
|
<a id="#(CLEANUP.__).DestroyMissile" >
|
||||||
<strong>CLEANUP:_DestroyGroup(GroupObject, CleanUpGroupName)</strong>
|
<strong>CLEANUP.__:DestroyMissile(MissileObject)</strong>
|
||||||
</a>
|
</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<p>Destroys a group from the simulator, but checks first if it is still existing!</p>
|
<p>Destroys a missile from the simulator, but checks first if it is still existing!</p>
|
||||||
|
|
||||||
<h3>Parameters</h3>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><code><em><a href="Dcs.DCSWrapper.Group.html##(Group)">Dcs.DCSWrapper.Group#Group</a> GroupObject </em></code>:
|
|
||||||
The object to be destroyed.</p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><code><em>#string CleanUpGroupName </em></code>:
|
|
||||||
The groupname...</p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<a id="#(CLEANUP)._DestroyMissile" >
|
|
||||||
<strong>CLEANUP:_DestroyMissile(MissileObject)</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p> 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</p>
|
|
||||||
|
|
||||||
<h3>Parameter</h3>
|
<h3>Parameter</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
||||||
<p><code><em> MissileObject </em></code>: </p>
|
<p><code><em><a href="Dcs.DCSTypes.html##(Weapon)">Dcs.DCSTypes#Weapon</a> MissileObject </em></code>: </p>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -589,8 +504,8 @@ The groupname...</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<a id="#(CLEANUP)._DestroyUnit" >
|
<a id="#(CLEANUP.__).DestroyUnit" >
|
||||||
<strong>CLEANUP:_DestroyUnit(CleanUpUnit)</strong>
|
<strong>CLEANUP.__:DestroyUnit(CleanUpUnit)</strong>
|
||||||
</a>
|
</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@ -611,8 +526,8 @@ The object to be destroyed.</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<a id="#(CLEANUP)._EventAddForCleanUp" >
|
<a id="#(CLEANUP.__).EventAddForCleanUp" >
|
||||||
<strong>CLEANUP:_EventAddForCleanUp(Event)</strong>
|
<strong>CLEANUP.__:EventAddForCleanUp(Event)</strong>
|
||||||
</a>
|
</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@ -626,6 +541,120 @@ The object to be destroyed.</p>
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
||||||
|
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> Event </em></code>: </p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<a id="#(CLEANUP.__).IsInAirbase" >
|
||||||
|
<strong>CLEANUP.__:IsInAirbase(Vec2)</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Parameter</h3>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<p><code><em> Vec2 </em></code>: </p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<a id="#(CLEANUP.__).OnEventBirth" >
|
||||||
|
<strong>CLEANUP.__:OnEventBirth(EventData)</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Parameter</h3>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> EventData </em></code>: </p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<a id="#(CLEANUP.__).OnEventCrash" >
|
||||||
|
<strong>CLEANUP.__:OnEventCrash(Event)</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
<p>Detects if a crash event occurs.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p>Crashed units go into a CleanUpList for removal.</p>
|
||||||
|
|
||||||
|
<h3>Parameter</h3>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> Event </em></code>: </p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<a id="#(CLEANUP.__).OnEventHit" >
|
||||||
|
<strong>CLEANUP.__:OnEventHit(Event)</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
<p>Detects if the Unit has an S<em>EVENT</em>HIT within the given AirbaseNames.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p>If this is the case, destroy the unit.</p>
|
||||||
|
|
||||||
|
<h3>Parameter</h3>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> Event </em></code>: </p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<a id="#(CLEANUP.__).OnEventShot" >
|
||||||
|
<strong>CLEANUP.__:OnEventShot(Event)</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
<p>Detects if a unit shoots a missile.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p>If this occurs within one of the airbases, then the weapon used must be destroyed.</p>
|
||||||
|
|
||||||
|
<h3>Parameter</h3>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
|
||||||
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> Event </em></code>: </p>
|
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> Event </em></code>: </p>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@ -2563,7 +2563,7 @@ The index of the DetectedItem.</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em></em>
|
<em>#number</em>
|
||||||
<a id="#(DETECTION_BASE).DetectionInterval" >
|
<a id="#(DETECTION_BASE).DetectionInterval" >
|
||||||
<strong>DETECTION_BASE.DetectionInterval</strong>
|
<strong>DETECTION_BASE.DetectionInterval</strong>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -1598,7 +1598,7 @@ A string defining the start state.</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em>#string</em>
|
<em></em>
|
||||||
<a id="#(FSM)._StartState" >
|
<a id="#(FSM)._StartState" >
|
||||||
<strong>FSM._StartState</strong>
|
<strong>FSM._StartState</strong>
|
||||||
</a>
|
</a>
|
||||||
@ -1897,6 +1897,7 @@ A string defining the start state.</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
|
<em></em>
|
||||||
<a id="#(FSM).current" >
|
<a id="#(FSM).current" >
|
||||||
<strong>FSM.current</strong>
|
<strong>FSM.current</strong>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -948,21 +948,11 @@ The POSITIONABLE is not existing or alive. </p>
|
|||||||
|
|
||||||
<p>Returns the POSITIONABLE velocity in km/h.</p>
|
<p>Returns the POSITIONABLE velocity in km/h.</p>
|
||||||
|
|
||||||
<h3>Return values</h3>
|
<h3>Return value</h3>
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><em>#number:</em>
|
<p><em>#number:</em>
|
||||||
The velocity in km/h</p>
|
The velocity in km/h</p>
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><em>#nil:</em>
|
|
||||||
The POSITIONABLE is not existing or alive. </p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
@ -976,21 +966,11 @@ The POSITIONABLE is not existing or alive. </p>
|
|||||||
|
|
||||||
<p>Returns the POSITIONABLE velocity in meters per second.</p>
|
<p>Returns the POSITIONABLE velocity in meters per second.</p>
|
||||||
|
|
||||||
<h3>Return values</h3>
|
<h3>Return value</h3>
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><em>#number:</em>
|
<p><em>#number:</em>
|
||||||
The velocity in meters per second.</p>
|
The velocity in meters per second.</p>
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<p><em>#nil:</em>
|
|
||||||
The POSITIONABLE is not existing or alive. </p>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
|
|||||||
@ -822,12 +822,6 @@ and any spaces before and after the resulting name are removed.</p>
|
|||||||
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
|
|
||||||
<td class="summary">
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -2732,9 +2726,6 @@ when nothing was spawned.</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p> Overwrite unit names by default with group name.</p>
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
@ -3733,20 +3724,6 @@ True = Continue Scheduler</p>
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<em></em>
|
|
||||||
<a id="#(SPAWN).uncontrolled" >
|
|
||||||
<strong>SPAWN.uncontrolled</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
|||||||
@ -436,6 +436,7 @@ ptional) The name of the new static.</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
|
<em>#number</em>
|
||||||
<a id="#(SPAWNSTATIC).SpawnIndex" >
|
<a id="#(SPAWNSTATIC).SpawnIndex" >
|
||||||
<strong>SPAWNSTATIC.SpawnIndex</strong>
|
<strong>SPAWNSTATIC.SpawnIndex</strong>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -765,7 +765,6 @@ true if it is lasing</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em></em>
|
|
||||||
<a id="#(SPOT).ScheduleID" >
|
<a id="#(SPOT).ScheduleID" >
|
||||||
<strong>SPOT.ScheduleID</strong>
|
<strong>SPOT.ScheduleID</strong>
|
||||||
</a>
|
</a>
|
||||||
@ -779,7 +778,6 @@ true if it is lasing</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em></em>
|
|
||||||
<a id="#(SPOT).SpotIR" >
|
<a id="#(SPOT).SpotIR" >
|
||||||
<strong>SPOT.SpotIR</strong>
|
<strong>SPOT.SpotIR</strong>
|
||||||
</a>
|
</a>
|
||||||
@ -793,7 +791,6 @@ true if it is lasing</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em></em>
|
|
||||||
<a id="#(SPOT).SpotLaser" >
|
<a id="#(SPOT).SpotLaser" >
|
||||||
<strong>SPOT.SpotLaser</strong>
|
<strong>SPOT.SpotLaser</strong>
|
||||||
</a>
|
</a>
|
||||||
@ -807,7 +804,6 @@ true if it is lasing</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em></em>
|
|
||||||
<a id="#(SPOT).Target" >
|
<a id="#(SPOT).Target" >
|
||||||
<strong>SPOT.Target</strong>
|
<strong>SPOT.Target</strong>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -510,7 +510,7 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em><a href="Core.Cargo.html##(CARGO)">Core.Cargo#CARGO</a></em>
|
<em><a href="Core.Cargo.html##(CARGO_GROUP)">Core.Cargo#CARGO_GROUP</a></em>
|
||||||
<a id="#(FSM_PROCESS).Cargo" >
|
<a id="#(FSM_PROCESS).Cargo" >
|
||||||
<strong>FSM_PROCESS.Cargo</strong>
|
<strong>FSM_PROCESS.Cargo</strong>
|
||||||
</a>
|
</a>
|
||||||
@ -524,6 +524,7 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
|
<em></em>
|
||||||
<a id="#(FSM_PROCESS).DeployZone" >
|
<a id="#(FSM_PROCESS).DeployZone" >
|
||||||
<strong>FSM_PROCESS.DeployZone</strong>
|
<strong>FSM_PROCESS.DeployZone</strong>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user