mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Implemented event dispatching for GROUP
-- Created EVT-200 test mission -- Documentation
This commit is contained in:
@@ -897,4 +897,29 @@ function GROUP:OnReSpawn( ReSpawnFunction )
|
||||
self.ReSpawnFunction = ReSpawnFunction
|
||||
end
|
||||
|
||||
do -- Event Handling
|
||||
|
||||
--- Subscribe to a DCS Event.
|
||||
-- @param #GROUP self
|
||||
-- @param Core.Event#EVENTS Event
|
||||
-- @param #function EventFunction (optional) The function to be called when the event occurs for the GROUP.
|
||||
-- @return #GROUP
|
||||
function GROUP:HandleEvent( Event, EventFunction )
|
||||
|
||||
self:EventDispatcher():OnEventForGroup( self:GetName(), EventFunction, self, Event )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- UnSubscribe to a DCS event.
|
||||
-- @param #GROUP self
|
||||
-- @param Core.Event#EVENTS Event
|
||||
-- @return #GROUP
|
||||
function GROUP:UnHandleEvent( Event )
|
||||
|
||||
self:EventDispatcher():RemoveForGroup( self:GetName(), self, Event )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user