mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
OK. got workiing prototype now, works!
This commit is contained in:
@@ -108,6 +108,7 @@ function STATEMACHINE:_create_transition(name)
|
|||||||
|
|
||||||
local fsmparent, event = self:_isendstate( to )
|
local fsmparent, event = self:_isendstate( to )
|
||||||
if fsmparent and event then
|
if fsmparent and event then
|
||||||
|
self:_call_handler(self["onstatechange"], params)
|
||||||
fsmparent[event]( fsmparent )
|
fsmparent[event]( fsmparent )
|
||||||
else
|
else
|
||||||
self:_call_handler(self["onenter" .. to] or self["on" .. to], params)
|
self:_call_handler(self["onenter" .. to] or self["on" .. to], params)
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ function TASK2_SEAD:New( Client, Mission, TargetSet )
|
|||||||
onMoreTargets = self.OnMoreTargets,
|
onMoreTargets = self.OnMoreTargets,
|
||||||
onDestroyed = self.OnDestroyed,
|
onDestroyed = self.OnDestroyed,
|
||||||
onKilled = self.OnKilled,
|
onKilled = self.OnKilled,
|
||||||
}
|
},
|
||||||
|
endstates = { 'Success', 'Failed' }
|
||||||
} )
|
} )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ local Task_Sead = STATEMACHINE:New( {
|
|||||||
{ name = 'Start', from = 'None', to = 'Unassigned' },
|
{ name = 'Start', from = 'None', to = 'Unassigned' },
|
||||||
{ name = 'Next', from = 'Unassigned', to = 'Assigned' },
|
{ name = 'Next', from = 'Unassigned', to = 'Assigned' },
|
||||||
-- { name = 'Route', from = 'Assigned', to = 'Arrived' },
|
-- { name = 'Route', from = 'Assigned', to = 'Arrived' },
|
||||||
{ name = 'Next', from = 'Assigned', to = 'Seading' },
|
{ name = 'Next', from = 'Assigned', to = 'Success' },
|
||||||
{ name = 'Destroyed', from = 'Destroy', to = 'Success' },
|
{ name = 'Failed', from = 'Assigned', to = 'Failed' },
|
||||||
},
|
},
|
||||||
subs = {
|
subs = {
|
||||||
Menu = { onstateparent = 'Unassigned', oneventparent = 'Start', fsm = Task_Menu.Fsm, event = 'Menu', returnevents = { 'Next' } },
|
Menu = { onstateparent = 'Unassigned', oneventparent = 'Start', fsm = Task_Menu.Fsm, event = 'Menu', returnevents = { 'Next' } },
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user