First prototype of the scheduler dispatcher is ready... It works, but the code was very difficult...

So, when the Scheduler that is passed to the AddScheduler is nillified,
the internal arrays that keep the Scheduler reference are also
nillified. And it does what i need for further utilization in MOOSE
classes. When the Scheduler is nillified, but, a schedule was planned
for that Scheduler, once the scheduler fires off, it will ignore that
call... cool.

Sven
This commit is contained in:
FlightControl
2016-12-12 16:44:56 +01:00
parent 24a6d37500
commit b81b483f0b
17 changed files with 481 additions and 174 deletions

View File

@@ -148,9 +148,7 @@ function TASK_BASE:New( Mission, SetGroupAssign, TaskName, TaskType )
self:UnAssignFromUnit( TaskUnit )
self:MessageToGroups( TaskUnit:GetPlayerName() .. " aborted Task " .. self:GetName() )
end
if self:HasAliveUnits() == false then
self:__Abort( 1 )
end
self:__Abort( 1 )
end
end
)
@@ -793,6 +791,27 @@ function TASK_BASE:SetBriefing( TaskBriefing )
return self
end
--- StateMachine callback function for a TASK
-- @param #TASK_BASE self
-- @param #string Event
-- @param #string From
-- @param #string To
-- @param Core.Event#EVENTDATA Event
function TASK_BASE:onbeforeAbort( Event, From, To )
self:E("Abort")
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
if self:HasAliveUnits() then
return false
end
end
self:MessageToGroups( "Task " .. self:GetName() .. " has been aborted! Task will be replanned." )
return true
end
--- StateMachine callback function for a TASK