mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'refs/remotes/origin/master' into FlightControl
# Conflicts: # Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua # Moose Mission Setup/Moose.lua # Moose Test Missions/SPA - Spawning/SPA-010 - Spawn Demo/SPA-010 - Spawn Demo.miz # Moose Test Missions/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.miz # Moose Test Missions/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.miz # Moose Test Missions/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.miz # Moose Test Missions/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.miz # Moose Test Missions/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.miz # Moose Test Missions/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.miz # Moose Test Missions/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.miz # Moose Test Missions/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.miz # Moose Test Missions/SPA - Spawning/SPA-100 - CleanUp Inactive Units/SPA-100 - CleanUp Inactive Units.miz # Moose Test Missions/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz # Moose Test Missions/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz # Moose Test Missions/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz # Moose Test Missions/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz # Moose Test Missions/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz # Moose Test Missions/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz # Moose Test Missions/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz # Moose Test Missions/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz # Moose Test Missions/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz # Moose Test Missions/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.miz # docs/Documentation/Zone.html
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
-- * @{#TASK.HasStateMachine}():Enquire if the task has a @{Fsm}
|
||||
-- * @{#TASK.AssignToUnit}(): Assign a task to a unit. (Needs to be implemented in the derived classes from @{#TASK}.
|
||||
-- * @{#TASK.UnAssignFromUnit}(): Unassign the task from a unit.
|
||||
-- * @{#TASK.SetTimeOut}(): Set timer in seconds before task gets cancelled if not assigned.
|
||||
--
|
||||
-- 1.2) Set and enquire task status (beyond the task state machine processing).
|
||||
-- ----------------------------------------------------------------------------
|
||||
@@ -70,6 +71,7 @@ TASK = {
|
||||
FsmTemplate = nil,
|
||||
Mission = nil,
|
||||
CommandCenter = nil,
|
||||
TimeOut = 0,
|
||||
}
|
||||
|
||||
--- FSM PlayerAborted event handler prototype for TASK.
|
||||
@@ -163,6 +165,7 @@ function TASK:New( Mission, SetGroupAssign, TaskName, TaskType )
|
||||
self:AddTransition( "*", "PlayerAborted", "*" )
|
||||
self:AddTransition( "*", "PlayerDead", "*" )
|
||||
self:AddTransition( { "Failed", "Aborted", "Cancelled" }, "Replan", "Planned" )
|
||||
self:AddTransition( "*", "TimeOut", "Cancelled" )
|
||||
|
||||
self:E( "New TASK " .. TaskName )
|
||||
|
||||
@@ -403,6 +406,17 @@ function TASK:UnAssignFromUnit( TaskUnit )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Sets the TimeOut for the @{Task}. If @{Task} stayed planned for longer than TimeOut, it gets into Cancelled status.
|
||||
-- @param #TASK self
|
||||
-- @param #integer Timer in seconds
|
||||
-- @return #TASK self
|
||||
function TASK:SetTimeOut ( Timer )
|
||||
self:F( Timer )
|
||||
self.TimeOut = Timer
|
||||
self:__TimeOut( self.TimeOut )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Send a message of the @{Task} to the assigned @{Group}s.
|
||||
-- @param #TASK self
|
||||
function TASK:MessageToGroups( Message )
|
||||
@@ -934,6 +948,30 @@ function TASK:onstatechange( From, Event, To )
|
||||
|
||||
end
|
||||
|
||||
--- FSM function for a TASK
|
||||
-- @param #TASK self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function TASK:onenterPlanned( From, Event, To)
|
||||
if not self.TimeOut == 0 then
|
||||
self.__TimeOut( self.TimeOut )
|
||||
end
|
||||
end
|
||||
|
||||
--- FSM function for a TASK
|
||||
-- @param #TASK self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function TASK:onbeforeTimeOut( From, Event, To )
|
||||
if From == "Planned" then
|
||||
self:RemoveMenu()
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
do -- Reporting
|
||||
|
||||
--- Create a summary report of the Task.
|
||||
|
||||
Reference in New Issue
Block a user