mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Improved the event handling
-- Removed the sort -- Implemented the order in the existing table. -- 5 levels -- _DATABASE = 1 -- SET and SET_ derived classes = 2 -- UNIT = 3 -- GROUP = 4 -- all other = 5
This commit is contained in:
@@ -181,6 +181,7 @@ local _ClassID = 0
|
||||
BASE = {
|
||||
ClassName = "BASE",
|
||||
ClassID = 0,
|
||||
_Private = {},
|
||||
Events = {},
|
||||
States = {}
|
||||
}
|
||||
@@ -287,6 +288,26 @@ function BASE:GetClassID()
|
||||
return self.ClassID
|
||||
end
|
||||
|
||||
--- Get the Class @{Core.Event} processing Priority.
|
||||
-- The Event processing Priority is a number from 1 to 10,
|
||||
-- reflecting the order of the classes subscribed to the Event to be processed.
|
||||
-- @param #BASE self
|
||||
-- @return #number The @{Core.Event} processing Priority.
|
||||
function BASE:GetEventPriority()
|
||||
return self._Private.EventPriority or 5
|
||||
end
|
||||
|
||||
--- Set the Class @{Core.Event} processing Priority.
|
||||
-- The Event processing Priority is a number from 1 to 10,
|
||||
-- reflecting the order of the classes subscribed to the Event to be processed.
|
||||
-- @param #BASE self
|
||||
-- @param #number EventPriority The @{Core.Event} processing Priority.
|
||||
-- @return self
|
||||
function BASE:SetEventPriority( EventPriority )
|
||||
self._Private.EventPriority = EventPriority
|
||||
end
|
||||
|
||||
|
||||
--- Set a new listener for the class.
|
||||
-- @param self
|
||||
-- @param Dcs.DCSTypes#Event Event
|
||||
|
||||
Reference in New Issue
Block a user