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:
FlightControl
2017-02-04 11:35:58 +01:00
parent ab345f5ad2
commit be4d51237b
10 changed files with 98 additions and 63503 deletions

View File

@@ -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