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:
FlightControl
2016-11-22 08:45:38 +01:00
parent 07f6760039
commit 2f4eb39156
13 changed files with 296 additions and 179 deletions

View File

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