mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Task Assignment
This commit is contained in:
@@ -441,6 +441,8 @@ do -- FSM
|
||||
-- @return #table
|
||||
function FSM:GetProcesses()
|
||||
|
||||
self:F( { Processes = self._Processes } )
|
||||
|
||||
return self._Processes or {}
|
||||
end
|
||||
|
||||
@@ -455,6 +457,18 @@ do -- FSM
|
||||
error( "Sub-Process from state " .. From .. " with event " .. Event .. " not found!" )
|
||||
end
|
||||
|
||||
function FSM:SetProcess( From, Event, Fsm )
|
||||
|
||||
for ProcessID, Process in pairs( self:GetProcesses() ) do
|
||||
if Process.From == From and Process.Event == Event then
|
||||
Process.fsm = Fsm
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
error( "Sub-Process from state " .. From .. " with event " .. Event .. " not found!" )
|
||||
end
|
||||
|
||||
--- Adds an End state.
|
||||
function FSM:AddEndState( State )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user