mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Jippie! Finally got the Sub Statemachine declaration understandable for end-users.
Reworked the hierarchical state machine processing in terms of sub processing. Now, the declaration and usage of subs is completely understandable and easy to implement. I am excited to see how end-users will see the possibilities.
This commit is contained in:
@@ -85,9 +85,16 @@ end
|
||||
-- @return #EVENT.Events
|
||||
function EVENT:Init( EventID, EventClass )
|
||||
self:F3( { _EVENTCODES[EventID], EventClass } )
|
||||
if not self.Events[EventID] then
|
||||
|
||||
if not self.Events[EventID] then
|
||||
self.Events[EventID] = {}
|
||||
|
||||
-- Create a WEAK table to ensure that the garbage collector is cleaning the event links when the object usage is cleaned.
|
||||
local Meta = {}
|
||||
setmetatable( self.Events[EventID], Meta )
|
||||
Meta.__mode = "k"
|
||||
end
|
||||
|
||||
if not self.Events[EventID][EventClass] then
|
||||
self.Events[EventID][EventClass] = {}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user