This commit is contained in:
FlightControl
2016-12-16 12:56:36 +01:00
parent 995e21e200
commit 33f42351e4
30 changed files with 538 additions and 601 deletions

View File

@@ -110,7 +110,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
-- The PlayerUnit will be UnAssigned from the Task.
-- When there is no Unit left running the Task, the Task goes into Abort...
self:EventOnPlayerLeaveUnit(
--- @param #TASK_BASE self
--- @param #TASK self
-- @param Core.Event#EVENTDATA EventData
function( self, EventData )
local PlayerUnit = EventData.IniUnit
@@ -124,7 +124,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
-- The PlayerUnit will be UnAssigned from the Task.
-- When there is no Unit left running the Task, the Task goes into Abort...
self:EventOnCrash(
--- @param #TASK_BASE self
--- @param #TASK self
-- @param Core.Event#EVENTDATA EventData
function( self, EventData )
local PlayerUnit = EventData.IniUnit

View File

@@ -317,7 +317,7 @@ do -- DETECTION_DISPATCHER
--- Creates a CAS task when there are targets for it.
-- @param #DETECTION_DISPATCHER self
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
-- @return Tasking.Task#TASK_BASE
-- @return Tasking.Task#TASK
function DETECTION_DISPATCHER:EvaluateCAS( DetectedArea )
self:F( { DetectedArea.AreaID } )
@@ -345,7 +345,7 @@ do -- DETECTION_DISPATCHER
--- Creates a BAI task when there are targets for it.
-- @param #DETECTION_DISPATCHER self
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
-- @return Tasking.Task#TASK_BASE
-- @return Tasking.Task#TASK
function DETECTION_DISPATCHER:EvaluateBAI( DetectedArea, FriendlyCoalition )
self:F( { DetectedArea.AreaID } )
@@ -374,9 +374,9 @@ do -- DETECTION_DISPATCHER
-- Can only occur when the DetectedArea is Changed AND the state of the Task is "Planned".
-- @param #DETECTION_DISPATCHER self
-- @param Tasking.Mission#MISSION Mission
-- @param Tasking.Task#TASK_BASE Task
-- @param Tasking.Task#TASK Task
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
-- @return Tasking.Task#TASK_BASE
-- @return Tasking.Task#TASK
function DETECTION_DISPATCHER:EvaluateRemoveTask( Mission, Task, DetectedArea )
if Task then

View File

@@ -7,7 +7,7 @@
-- @field #MISSION.Clients _Clients
-- @field Core.Menu#MENU_COALITION MissionMenu
-- @field #string MissionBriefing
-- @extends Fsm.Fsm#FSM
-- @extends Core.Fsm#FSM
MISSION = {
ClassName = "MISSION",
Name = "",
@@ -40,7 +40,7 @@ MISSION = {
-- @return #MISSION self
function MISSION:New( CommandCenter, MissionName, MissionPriority, MissionBriefing, MissionCoalition )
local self = BASE:Inherit( self, FSM:New() ) -- Fsm.Fsm#FSM
local self = BASE:Inherit( self, FSM:New() ) -- Core.Fsm#FSM
self:SetStartState( "Idle" )
@@ -72,7 +72,7 @@ end
function MISSION:onbeforeComplete( Event, From, To )
for TaskID, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK_BASE
local Task = Task -- Tasking.Task#TASK
if not Task:IsStateSuccess() and not Task:IsStateFailed() and not Task:IsStateAborted() and not Task:IsStateCancelled() then
return false -- Mission cannot be completed. Other Tasks are still active.
end
@@ -110,7 +110,7 @@ function MISSION:JoinUnit( PlayerUnit )
local PlayerUnitAdded = false
for TaskID, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK_BASE
local Task = Task -- Tasking.Task#TASK
if Task:JoinUnit( PlayerUnit ) then
PlayerUnitAdded = true
end
@@ -184,7 +184,7 @@ function MISSION:GetGroups()
local SetGroup = SET_GROUP:New()
for TaskID, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK_BASE
local Task = Task -- Tasking.Task#TASK
local GroupSet = Task:GetGroups()
GroupSet:ForEachGroup(
function( TaskGroup )
@@ -205,7 +205,7 @@ function MISSION:SetMenu()
self:F()
for _, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK_BASE
local Task = Task -- Tasking.Task#TASK
Task:SetMenu()
end
end
@@ -220,13 +220,13 @@ end
--- Sets the Assigned Task menu.
-- @param #MISSION self
-- @param Tasking.Task#TASK_BASE Task
-- @param Tasking.Task#TASK Task
-- @param #string MenuText The menu text.
-- @return #MISSION self
function MISSION:SetAssignedMenu( Task )
for _, Task in pairs( self.Tasks ) do
local Task = Task -- Tasking.Task#TASK_BASE
local Task = Task -- Tasking.Task#TASK
Task:RemoveMenu()
Task:SetAssignedMenu()
end
@@ -235,7 +235,7 @@ end
--- Removes a Task menu.
-- @param #MISSION self
-- @param Tasking.Task#TASK_BASE Task
-- @param Tasking.Task#TASK Task
-- @return #MISSION self
function MISSION:RemoveTaskMenu( Task )
@@ -271,7 +271,7 @@ end
--- Get the TASK identified by the TaskNumber from the Mission. This function is useful in GoalFunctions.
-- @param #string TaskName The Name of the @{Task} within the @{Mission}.
-- @return Tasking.Task#TASK_BASE The Task
-- @return Tasking.Task#TASK The Task
-- @return #nil Returns nil if no task was found.
function MISSION:GetTask( TaskName )
self:F( { TaskName } )
@@ -284,8 +284,8 @@ end
-- Note that there can be multiple @{Task}s registered to be completed.
-- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.
-- @param #MISSION self
-- @param Tasking.Task#TASK_BASE Task is the @{Task} object.
-- @return Tasking.Task#TASK_BASE The task added.
-- @param Tasking.Task#TASK Task is the @{Task} object.
-- @return Tasking.Task#TASK The task added.
function MISSION:AddTask( Task )
local TaskName = Task:GetTaskName()
@@ -304,7 +304,7 @@ end
-- Note that there can be multiple @{Task}s registered to be completed.
-- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.
-- @param #MISSION self
-- @param Tasking.Task#TASK_BASE Task is the @{Task} object.
-- @param Tasking.Task#TASK Task is the @{Task} object.
-- @return #nil The cleaned Task reference.
function MISSION:RemoveTask( Task )
@@ -326,8 +326,8 @@ end
--- Return the next @{Task} ID to be completed within the @{Mission}.
-- @param #MISSION self
-- @param Tasking.Task#TASK_BASE Task is the @{Task} object.
-- @return Tasking.Task#TASK_BASE The task added.
-- @param Tasking.Task#TASK Task is the @{Task} object.
-- @return Tasking.Task#TASK The task added.
function MISSION:GetNextTaskID( Task )
local TaskName = Task:GetTaskName()
@@ -413,7 +413,7 @@ function MISSION:HasGroup( TaskGroup )
local Has = false
for TaskID, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK_BASE
local Task = Task -- Tasking.Task#TASK
if Task:HasGroup( TaskGroup ) then
Has = true
break
@@ -439,7 +439,7 @@ function MISSION:ReportSummary()
-- Determine how many tasks are remaining.
local TasksRemaining = 0
for TaskID, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK_BASE
local Task = Task -- Tasking.Task#TASK
if Task:IsStateSuccess() or Task:IsStateFailed() then
else
TasksRemaining = TasksRemaining + 1
@@ -469,7 +469,7 @@ function MISSION:ReportOverview()
-- Determine how many tasks are remaining.
local TasksRemaining = 0
for TaskID, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK_BASE
local Task = Task -- Tasking.Task#TASK
Report:Add( "- " .. Task:ReportSummary() )
end
@@ -494,7 +494,7 @@ function MISSION:ReportDetails()
-- Determine how many tasks are remaining.
local TasksRemaining = 0
for TaskID, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK_BASE
local Task = Task -- Tasking.Task#TASK
Report:Add( Task:ReportDetails() )
end

View File

@@ -1,19 +1,19 @@
--- This module contains the TASK_BASE class.
--- This module contains the TASK class.
--
-- 1) @{#TASK_BASE} class, extends @{Core.Base#BASE}
-- 1) @{#TASK} class, extends @{Core.Base#BASE}
-- ============================================
-- 1.1) The @{#TASK_BASE} class implements the methods for task orchestration within MOOSE.
-- 1.1) The @{#TASK} class implements the methods for task orchestration within MOOSE.
-- ----------------------------------------------------------------------------------------
-- The class provides a couple of methods to:
--
-- * @{#TASK_BASE.AssignToGroup}():Assign a task to a group (of players).
-- * @{#TASK_BASE.AddProcess}():Add a @{Process} to a task.
-- * @{#TASK_BASE.RemoveProcesses}():Remove a running @{Process} from a running task.
-- * @{#TASK_BASE.SetStateMachine}():Set a @{Fsm} to a task.
-- * @{#TASK_BASE.RemoveStateMachine}():Remove @{Fsm} from a task.
-- * @{#TASK_BASE.HasStateMachine}():Enquire if the task has a @{Fsm}
-- * @{#TASK_BASE.AssignToUnit}(): Assign a task to a unit. (Needs to be implemented in the derived classes from @{#TASK_BASE}.
-- * @{#TASK_BASE.UnAssignFromUnit}(): Unassign the task from a unit.
-- * @{#TASK.AssignToGroup}():Assign a task to a group (of players).
-- * @{#TASK.AddProcess}():Add a @{Process} to a task.
-- * @{#TASK.RemoveProcesses}():Remove a running @{Process} from a running task.
-- * @{#TASK.SetStateMachine}():Set a @{Fsm} to a task.
-- * @{#TASK.RemoveStateMachine}():Remove @{Fsm} from a task.
-- * @{#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.
--
-- 1.2) Set and enquire task status (beyond the task state machine processing).
-- ----------------------------------------------------------------------------
@@ -37,7 +37,7 @@
-- 1.3) Add scoring when reaching a certain task status:
-- -----------------------------------------------------
-- Upon reaching a certain task status in a task, additional scoring can be given. If the Mission has a scoring system attached, the scores will be added to the mission scoring.
-- Use the method @{#TASK_BASE.AddScore}() to add scores when a status is reached.
-- Use the method @{#TASK.AddScore}() to add scores when a status is reached.
--
-- 1.4) Task briefing:
-- -------------------
@@ -49,17 +49,17 @@
--
-- @module Task
--- The TASK_BASE class
-- @type TASK_BASE
--- The TASK class
-- @type TASK
-- @field Core.Scheduler#SCHEDULER TaskScheduler
-- @field Tasking.Mission#MISSION Mission
-- @field Core.Set#SET_GROUP SetGroup The Set of Groups assigned to the Task
-- @field Fsm.Fsm#FSM_PROCESS FsmTemplate
-- @field Core.Fsm#FSM_PROCESS FsmTemplate
-- @field Tasking.Mission#MISSION Mission
-- @field Tasking.CommandCenter#COMMANDCENTER CommandCenter
-- @extends Fsm.Fsm#FSM_TASK
TASK_BASE = {
ClassName = "TASK_BASE",
-- @extends Core.Fsm#FSM_TASK
TASK = {
ClassName = "TASK",
TaskScheduler = nil,
ProcessClasses = {}, -- The container of the Process classes that will be used to create and assign new processes for the task to ProcessUnits.
Processes = {}, -- The container of actual process objects instantiated and assigned to ProcessUnits.
@@ -72,85 +72,85 @@ TASK_BASE = {
CommandCenter = nil,
}
--- FSM PlayerAborted event handler prototype for TASK_BASE.
-- @function [parent=#TASK_BASE] OnAfterPlayerAborted
-- @param #TASK_BASE self
--- FSM PlayerAborted event handler prototype for TASK.
-- @function [parent=#TASK] OnAfterPlayerAborted
-- @param #TASK self
-- @param Wrapper.Unit#UNIT PlayerUnit The Unit of the Player when he went back to spectators or left the mission.
-- @param #string PlayerName The name of the Player.
--- FSM PlayerCrashed event handler prototype for TASK_BASE.
-- @function [parent=#TASK_BASE] OnAfterPlayerCrashed
-- @param #TASK_BASE self
--- FSM PlayerCrashed event handler prototype for TASK.
-- @function [parent=#TASK] OnAfterPlayerCrashed
-- @param #TASK self
-- @param Wrapper.Unit#UNIT PlayerUnit The Unit of the Player when he crashed in the mission.
-- @param #string PlayerName The name of the Player.
--- FSM PlayerDead event handler prototype for TASK_BASE.
-- @function [parent=#TASK_BASE] OnAfterPlayerDead
-- @param #TASK_BASE self
--- FSM PlayerDead event handler prototype for TASK.
-- @function [parent=#TASK] OnAfterPlayerDead
-- @param #TASK self
-- @param Wrapper.Unit#UNIT PlayerUnit The Unit of the Player when he died in the mission.
-- @param #string PlayerName The name of the Player.
--- FSM Fail synchronous event function for TASK_BASE.
--- FSM Fail synchronous event function for TASK.
-- Use this event to Fail the Task.
-- @function [parent=#TASK_BASE] Fail
-- @param #TASK_BASE self
-- @function [parent=#TASK] Fail
-- @param #TASK self
--- FSM Fail asynchronous event function for TASK_BASE.
--- FSM Fail asynchronous event function for TASK.
-- Use this event to Fail the Task.
-- @function [parent=#TASK_BASE] __Fail
-- @param #TASK_BASE self
-- @function [parent=#TASK] __Fail
-- @param #TASK self
--- FSM Abort synchronous event function for TASK_BASE.
--- FSM Abort synchronous event function for TASK.
-- Use this event to Abort the Task.
-- @function [parent=#TASK_BASE] Abort
-- @param #TASK_BASE self
-- @function [parent=#TASK] Abort
-- @param #TASK self
--- FSM Abort asynchronous event function for TASK_BASE.
--- FSM Abort asynchronous event function for TASK.
-- Use this event to Abort the Task.
-- @function [parent=#TASK_BASE] __Abort
-- @param #TASK_BASE self
-- @function [parent=#TASK] __Abort
-- @param #TASK self
--- FSM Success synchronous event function for TASK_BASE.
--- FSM Success synchronous event function for TASK.
-- Use this event to make the Task a Success.
-- @function [parent=#TASK_BASE] Success
-- @param #TASK_BASE self
-- @function [parent=#TASK] Success
-- @param #TASK self
--- FSM Success asynchronous event function for TASK_BASE.
--- FSM Success asynchronous event function for TASK.
-- Use this event to make the Task a Success.
-- @function [parent=#TASK_BASE] __Success
-- @param #TASK_BASE self
-- @function [parent=#TASK] __Success
-- @param #TASK self
--- FSM Cancel synchronous event function for TASK_BASE.
--- FSM Cancel synchronous event function for TASK.
-- Use this event to Cancel the Task.
-- @function [parent=#TASK_BASE] Cancel
-- @param #TASK_BASE self
-- @function [parent=#TASK] Cancel
-- @param #TASK self
--- FSM Cancel asynchronous event function for TASK_BASE.
--- FSM Cancel asynchronous event function for TASK.
-- Use this event to Cancel the Task.
-- @function [parent=#TASK_BASE] __Cancel
-- @param #TASK_BASE self
-- @function [parent=#TASK] __Cancel
-- @param #TASK self
--- FSM Replan synchronous event function for TASK_BASE.
--- FSM Replan synchronous event function for TASK.
-- Use this event to Replan the Task.
-- @function [parent=#TASK_BASE] Replan
-- @param #TASK_BASE self
-- @function [parent=#TASK] Replan
-- @param #TASK self
--- FSM Replan asynchronous event function for TASK_BASE.
--- FSM Replan asynchronous event function for TASK.
-- Use this event to Replan the Task.
-- @function [parent=#TASK_BASE] __Replan
-- @param #TASK_BASE self
-- @function [parent=#TASK] __Replan
-- @param #TASK self
--- Instantiates a new TASK_BASE. Should never be used. Interface Class.
-- @param #TASK_BASE self
--- Instantiates a new TASK. Should never be used. Interface Class.
-- @param #TASK self
-- @param Tasking.Mission#MISSION Mission The mission wherein the Task is registered.
-- @param Core.Set#SET_GROUP SetGroupAssign The set of groups for which the Task can be assigned.
-- @param #string TaskName The name of the Task
-- @param #string TaskType The type of the Task
-- @return #TASK_BASE self
function TASK_BASE:New( Mission, SetGroupAssign, TaskName, TaskType )
-- @return #TASK self
function TASK:New( Mission, SetGroupAssign, TaskName, TaskType )
local self = BASE:Inherit( self, FSM_TASK:New() ) -- Fsm.Fsm#FSM_TASK
local self = BASE:Inherit( self, FSM_TASK:New() ) -- Core.Fsm#FSM_TASK
self:SetStartState( "Planned" )
self:AddTransition( "Planned", "Assign", "Assigned" )
@@ -189,7 +189,7 @@ function TASK_BASE:New( Mission, SetGroupAssign, TaskName, TaskType )
-- The Task is UnAssigned from the Unit.
-- When there is no Unit left running the Task, and all of the Players crashed, the Task goes into Failed ...
-- self:EventOnCrash(
-- --- @param #TASK_BASE self
-- --- @param #TASK self
-- -- @param Core.Event#EVENTDATA EventData
-- function( self, EventData )
-- self:E( "In LeaveUnit" )
@@ -213,17 +213,17 @@ function TASK_BASE:New( Mission, SetGroupAssign, TaskName, TaskType )
end
--- Get the Task FSM Process Template
-- @param #TASK_BASE self
-- @return Fsm.Fsm#FSM_PROCESS
function TASK_BASE:GetUnitProcess()
-- @param #TASK self
-- @return Core.Fsm#FSM_PROCESS
function TASK:GetUnitProcess()
return self.FsmTemplate
end
--- Sets the Task FSM Process Template
-- @param #TASK_BASE self
-- @param Fsm.Fsm#FSM_PROCESS
function TASK_BASE:SetUnitProcess( FsmTemplate )
-- @param #TASK self
-- @param Core.Fsm#FSM_PROCESS
function TASK:SetUnitProcess( FsmTemplate )
self.FsmTemplate = FsmTemplate
end
@@ -232,10 +232,10 @@ end
-- For each Group within the Task, the Unit is check if it can join the Task.
-- If the Unit was not part of the Task, false is returned.
-- If the Unit is part of the Task, true is returned.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Unit#UNIT PlayerUnit The CLIENT or UNIT of the Player joining the Mission.
-- @return #boolean true if Unit is part of the Task.
function TASK_BASE:JoinUnit( PlayerUnit )
function TASK:JoinUnit( PlayerUnit )
self:F( { PlayerUnit = PlayerUnit } )
local PlayerUnitAdded = false
@@ -268,10 +268,10 @@ end
--- Abort a PlayerUnit from a Task.
-- If the Unit was not part of the Task, false is returned.
-- If the Unit is part of the Task, true is returned.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Unit#UNIT PlayerUnit The CLIENT or UNIT of the Player aborting the Task.
-- @return #boolean true if Unit is part of the Task.
function TASK_BASE:AbortUnit( PlayerUnit )
function TASK:AbortUnit( PlayerUnit )
self:F( { PlayerUnit = PlayerUnit } )
local PlayerUnitAborted = false
@@ -306,10 +306,10 @@ end
--- A PlayerUnit crashed in a Task. Abort the Player.
-- If the Unit was not part of the Task, false is returned.
-- If the Unit is part of the Task, true is returned.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Unit#UNIT PlayerUnit The CLIENT or UNIT of the Player aborting the Task.
-- @return #boolean true if Unit is part of the Task.
function TASK_BASE:CrashUnit( PlayerUnit )
function TASK:CrashUnit( PlayerUnit )
self:F( { PlayerUnit = PlayerUnit } )
local PlayerUnitCrashed = false
@@ -344,28 +344,28 @@ end
--- Gets the Mission to where the TASK belongs.
-- @param #TASK_BASE self
-- @param #TASK self
-- @return Tasking.Mission#MISSION
function TASK_BASE:GetMission()
function TASK:GetMission()
return self.Mission
end
--- Gets the SET_GROUP assigned to the TASK.
-- @param #TASK_BASE self
-- @param #TASK self
-- @return Core.Set#SET_GROUP
function TASK_BASE:GetGroups()
function TASK:GetGroups()
return self.SetGroup
end
--- Assign the @{Task}to a @{Group}.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup
-- @return #TASK_BASE
function TASK_BASE:AssignToGroup( TaskGroup )
-- @return #TASK
function TASK:AssignToGroup( TaskGroup )
self:F2( TaskGroup:GetName() )
local TaskGroupName = TaskGroup:GetName()
@@ -389,10 +389,10 @@ function TASK_BASE:AssignToGroup( TaskGroup )
end
---
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Group#GROUP FindGroup
-- @return #boolean
function TASK_BASE:HasGroup( FindGroup )
function TASK:HasGroup( FindGroup )
self:GetGroups():FilterOnce() -- Ensure that the filter is updated.
return self:GetGroups():IsIncludeObject( FindGroup )
@@ -400,16 +400,16 @@ function TASK_BASE:HasGroup( FindGroup )
end
--- Assign the @{Task} to an alive @{Unit}.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_BASE self
function TASK_BASE:AssignToUnit( TaskUnit )
-- @return #TASK self
function TASK:AssignToUnit( TaskUnit )
self:F( TaskUnit:GetName() )
local FsmTemplate = self:GetUnitProcess()
-- Assign a new FsmUnit to TaskUnit.
local FsmUnit = self:SetStateMachine( TaskUnit, FsmTemplate:Copy( TaskUnit, self ) ) -- Fsm.Fsm#FSM_PROCESS
local FsmUnit = self:SetStateMachine( TaskUnit, FsmTemplate:Copy( TaskUnit, self ) ) -- Core.Fsm#FSM_PROCESS
self:E({"Address FsmUnit", tostring( FsmUnit ) } )
FsmUnit:SetStartState( "Planned" )
@@ -419,10 +419,10 @@ function TASK_BASE:AssignToUnit( TaskUnit )
end
--- UnAssign the @{Task} from an alive @{Unit}.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_BASE self
function TASK_BASE:UnAssignFromUnit( TaskUnit )
-- @return #TASK self
function TASK:UnAssignFromUnit( TaskUnit )
self:F( TaskUnit )
self:RemoveStateMachine( TaskUnit )
@@ -431,8 +431,8 @@ function TASK_BASE:UnAssignFromUnit( TaskUnit )
end
--- Send a message of the @{Task} to the assigned @{Group}s.
-- @param #TASK_BASE self
function TASK_BASE:MessageToGroups( Message )
-- @param #TASK self
function TASK:MessageToGroups( Message )
self:F( { Message = Message } )
local Mission = self:GetMission()
@@ -445,8 +445,8 @@ end
--- Send the briefng message of the @{Task} to the assigned @{Group}s.
-- @param #TASK_BASE self
function TASK_BASE:SendBriefingToAssignedGroups()
-- @param #TASK self
function TASK:SendBriefingToAssignedGroups()
self:F2()
for TaskGroupName, TaskGroup in pairs( self.SetGroup:GetSet() ) do
@@ -459,8 +459,8 @@ end
--- Assign the @{Task} from the @{Group}s.
-- @param #TASK_BASE self
function TASK_BASE:UnAssignFromGroups()
-- @param #TASK self
function TASK:UnAssignFromGroups()
self:F2()
for TaskGroupName, TaskGroup in pairs( self.SetGroup:GetSet() ) do
@@ -481,10 +481,10 @@ function TASK_BASE:UnAssignFromGroups()
end
--- Returns if the @{Task} is assigned to the Group.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup
-- @return #boolean
function TASK_BASE:IsAssignedToGroup( TaskGroup )
function TASK:IsAssignedToGroup( TaskGroup )
local TaskGroupName = TaskGroup:GetName()
@@ -498,9 +498,9 @@ function TASK_BASE:IsAssignedToGroup( TaskGroup )
end
--- Returns if the @{Task} has still alive and assigned Units.
-- @param #TASK_BASE self
-- @param #TASK self
-- @return #boolean
function TASK_BASE:HasAliveUnits()
function TASK:HasAliveUnits()
self:F()
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
@@ -521,8 +521,8 @@ function TASK_BASE:HasAliveUnits()
end
--- Set the menu options of the @{Task} to all the groups in the SetGroup.
-- @param #TASK_BASE self
function TASK_BASE:SetMenu()
-- @param #TASK self
function TASK:SetMenu()
self:F()
self.SetGroup:Flush()
@@ -536,9 +536,9 @@ end
--- Remove the menu options of the @{Task} to all the groups in the SetGroup.
-- @param #TASK_BASE self
-- @return #TASK_BASE self
function TASK_BASE:RemoveMenu()
-- @param #TASK self
-- @return #TASK self
function TASK:RemoveMenu()
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
self:RemoveMenuForGroup( TaskGroup )
@@ -547,8 +547,8 @@ end
--- Set the Menu for a Group
-- @param #TASK_BASE self
function TASK_BASE:SetMenuForGroup( TaskGroup )
-- @param #TASK self
function TASK:SetMenuForGroup( TaskGroup )
if not self:IsAssignedToGroup( TaskGroup ) then
self:SetPlannedMenuForGroup( TaskGroup, self:GetTaskName() )
@@ -559,11 +559,11 @@ end
--- Set the planned menu option of the @{Task}.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup
-- @param #string MenuText The menu text.
-- @return #TASK_BASE self
function TASK_BASE:SetPlannedMenuForGroup( TaskGroup, MenuText )
-- @return #TASK self
function TASK:SetPlannedMenuForGroup( TaskGroup, MenuText )
self:E( TaskGroup:GetName() )
local Mission = self:GetMission()
@@ -577,10 +577,10 @@ function TASK_BASE:SetPlannedMenuForGroup( TaskGroup, MenuText )
end
--- Set the assigned menu options of the @{Task}.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup
-- @return #TASK_BASE self
function TASK_BASE:SetAssignedMenuForGroup( TaskGroup )
-- @return #TASK self
function TASK:SetAssignedMenuForGroup( TaskGroup )
self:E( TaskGroup:GetName() )
local Mission = self:GetMission()
@@ -595,10 +595,10 @@ function TASK_BASE:SetAssignedMenuForGroup( TaskGroup )
end
--- Remove the menu option of the @{Task} for a @{Group}.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup
-- @return #TASK_BASE self
function TASK_BASE:RemoveMenuForGroup( TaskGroup )
-- @return #TASK self
function TASK:RemoveMenuForGroup( TaskGroup )
local Mission = self:GetMission()
local MissionName = Mission:GetName()
@@ -607,7 +607,7 @@ function TASK_BASE:RemoveMenuForGroup( TaskGroup )
MissionMenu:Remove()
end
function TASK_BASE.MenuAssignToGroup( MenuParam )
function TASK.MenuAssignToGroup( MenuParam )
local self = MenuParam.self
local TaskGroup = MenuParam.TaskGroup
@@ -617,7 +617,7 @@ function TASK_BASE.MenuAssignToGroup( MenuParam )
self:AssignToGroup( TaskGroup )
end
function TASK_BASE.MenuTaskStatus( MenuParam )
function TASK.MenuTaskStatus( MenuParam )
local self = MenuParam.self
local TaskGroup = MenuParam.TaskGroup
@@ -625,7 +625,7 @@ function TASK_BASE.MenuTaskStatus( MenuParam )
--self:AssignToGroup( TaskGroup )
end
function TASK_BASE.MenuTaskAbort( MenuParam )
function TASK.MenuTaskAbort( MenuParam )
local self = MenuParam.self
local TaskGroup = MenuParam.TaskGroup
@@ -636,9 +636,9 @@ end
--- Returns the @{Task} name.
-- @param #TASK_BASE self
-- @param #TASK self
-- @return #string TaskName
function TASK_BASE:GetTaskName()
function TASK:GetTaskName()
return self.TaskName
end
@@ -646,10 +646,10 @@ end
--- Get the default or currently assigned @{Process} template with key ProcessName.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string ProcessName
-- @return Fsm.Fsm#FSM_PROCESS
function TASK_BASE:GetProcessTemplate( ProcessName )
-- @return Core.Fsm#FSM_PROCESS
function TASK:GetProcessTemplate( ProcessName )
local ProcessTemplate = self.ProcessClasses[ProcessName]
@@ -660,10 +660,10 @@ end
-- TODO: Obscolete?
--- Fail processes from @{Task} with key @{Unit}
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string TaskUnitName
-- @return #TASK_BASE self
function TASK_BASE:FailProcesses( TaskUnitName )
-- @return #TASK self
function TASK:FailProcesses( TaskUnitName )
for ProcessID, ProcessData in pairs( self.Processes[TaskUnitName] ) do
local Process = ProcessData
@@ -672,10 +672,10 @@ function TASK_BASE:FailProcesses( TaskUnitName )
end
--- Add a FiniteStateMachine to @{Task} with key Task@{Unit}
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_BASE self
function TASK_BASE:SetStateMachine( TaskUnit, Fsm )
-- @return #TASK self
function TASK:SetStateMachine( TaskUnit, Fsm )
self:F( { TaskUnit, self.Fsm[TaskUnit] ~= nil } )
self.Fsm[TaskUnit] = Fsm
@@ -684,10 +684,10 @@ function TASK_BASE:SetStateMachine( TaskUnit, Fsm )
end
--- Remove FiniteStateMachines from @{Task} with key Task@{Unit}
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_BASE self
function TASK_BASE:RemoveStateMachine( TaskUnit )
-- @return #TASK self
function TASK:RemoveStateMachine( TaskUnit )
self:F( { TaskUnit, self.Fsm[TaskUnit] ~= nil } )
self.Fsm[TaskUnit] = nil
@@ -696,10 +696,10 @@ function TASK_BASE:RemoveStateMachine( TaskUnit )
end
--- Checks if there is a FiniteStateMachine assigned to Task@{Unit} for @{Task}
-- @param #TASK_BASE self
-- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_BASE self
function TASK_BASE:HasStateMachine( TaskUnit )
-- @return #TASK self
function TASK:HasStateMachine( TaskUnit )
self:F( { TaskUnit, self.Fsm[TaskUnit] ~= nil } )
return ( self.Fsm[TaskUnit] ~= nil )
@@ -707,17 +707,17 @@ end
--- Gets the Scoring of the task
-- @param #TASK_BASE self
-- @param #TASK self
-- @return Functional.Scoring#SCORING Scoring
function TASK_BASE:GetScoring()
function TASK:GetScoring()
return self.Mission:GetScoring()
end
--- Gets the Task Index, which is a combination of the Task type, the Task name.
-- @param #TASK_BASE self
-- @param #TASK self
-- @return #string The Task ID
function TASK_BASE:GetTaskIndex()
function TASK:GetTaskIndex()
local TaskType = self:GetType()
local TaskName = self:GetName()
@@ -726,137 +726,137 @@ function TASK_BASE:GetTaskIndex()
end
--- Sets the Name of the Task
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string TaskName
function TASK_BASE:SetName( TaskName )
function TASK:SetName( TaskName )
self.TaskName = TaskName
end
--- Gets the Name of the Task
-- @param #TASK_BASE self
-- @param #TASK self
-- @return #string The Task Name
function TASK_BASE:GetName()
function TASK:GetName()
return self.TaskName
end
--- Sets the Type of the Task
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string TaskType
function TASK_BASE:SetType( TaskType )
function TASK:SetType( TaskType )
self.TaskType = TaskType
end
--- Gets the Type of the Task
-- @param #TASK_BASE self
-- @param #TASK self
-- @return #string TaskType
function TASK_BASE:GetType()
function TASK:GetType()
return self.TaskType
end
--- Sets the ID of the Task
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string TaskID
function TASK_BASE:SetID( TaskID )
function TASK:SetID( TaskID )
self.TaskID = TaskID
end
--- Gets the ID of the Task
-- @param #TASK_BASE self
-- @param #TASK self
-- @return #string TaskID
function TASK_BASE:GetID()
function TASK:GetID()
return self.TaskID
end
--- Sets a @{Task} to status **Success**.
-- @param #TASK_BASE self
function TASK_BASE:StateSuccess()
-- @param #TASK self
function TASK:StateSuccess()
self:SetState( self, "State", "Success" )
return self
end
--- Is the @{Task} status **Success**.
-- @param #TASK_BASE self
function TASK_BASE:IsStateSuccess()
-- @param #TASK self
function TASK:IsStateSuccess()
return self:Is( "Success" )
end
--- Sets a @{Task} to status **Failed**.
-- @param #TASK_BASE self
function TASK_BASE:StateFailed()
-- @param #TASK self
function TASK:StateFailed()
self:SetState( self, "State", "Failed" )
return self
end
--- Is the @{Task} status **Failed**.
-- @param #TASK_BASE self
function TASK_BASE:IsStateFailed()
-- @param #TASK self
function TASK:IsStateFailed()
return self:Is( "Failed" )
end
--- Sets a @{Task} to status **Planned**.
-- @param #TASK_BASE self
function TASK_BASE:StatePlanned()
-- @param #TASK self
function TASK:StatePlanned()
self:SetState( self, "State", "Planned" )
return self
end
--- Is the @{Task} status **Planned**.
-- @param #TASK_BASE self
function TASK_BASE:IsStatePlanned()
-- @param #TASK self
function TASK:IsStatePlanned()
return self:Is( "Planned" )
end
--- Sets a @{Task} to status **Assigned**.
-- @param #TASK_BASE self
function TASK_BASE:StateAssigned()
-- @param #TASK self
function TASK:StateAssigned()
self:SetState( self, "State", "Assigned" )
return self
end
--- Is the @{Task} status **Assigned**.
-- @param #TASK_BASE self
function TASK_BASE:IsStateAssigned()
-- @param #TASK self
function TASK:IsStateAssigned()
return self:Is( "Assigned" )
end
--- Sets a @{Task} to status **Hold**.
-- @param #TASK_BASE self
function TASK_BASE:StateHold()
-- @param #TASK self
function TASK:StateHold()
self:SetState( self, "State", "Hold" )
return self
end
--- Is the @{Task} status **Hold**.
-- @param #TASK_BASE self
function TASK_BASE:IsStateHold()
-- @param #TASK self
function TASK:IsStateHold()
return self:Is( "Hold" )
end
--- Sets a @{Task} to status **Replanned**.
-- @param #TASK_BASE self
function TASK_BASE:StateReplanned()
-- @param #TASK self
function TASK:StateReplanned()
self:SetState( self, "State", "Replanned" )
return self
end
--- Is the @{Task} status **Replanned**.
-- @param #TASK_BASE self
function TASK_BASE:IsStateReplanned()
-- @param #TASK self
function TASK:IsStateReplanned()
return self:Is( "Replanned" )
end
--- Gets the @{Task} status.
-- @param #TASK_BASE self
function TASK_BASE:GetStateString()
-- @param #TASK self
function TASK:GetStateString()
return self:GetState( self, "State" )
end
--- Sets a @{Task} briefing.
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string TaskBriefing
-- @return #TASK_BASE self
function TASK_BASE:SetBriefing( TaskBriefing )
-- @return #TASK self
function TASK:SetBriefing( TaskBriefing )
self.TaskBriefing = TaskBriefing
return self
end
@@ -865,11 +865,11 @@ end
--- FSM function for a TASK
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string Event
-- @param #string From
-- @param #string To
function TASK_BASE:onenterAssigned( Event, From, To )
function TASK:onenterAssigned( Event, From, To )
self:E("Task Assigned")
@@ -879,11 +879,11 @@ end
--- FSM function for a TASK
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string Event
-- @param #string From
-- @param #string To
function TASK_BASE:onenterSuccess( Event, From, To )
function TASK:onenterSuccess( Event, From, To )
self:E( "Task Success" )
@@ -896,11 +896,11 @@ end
--- FSM function for a TASK
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string Event
-- @param #string From
-- @param #string To
function TASK_BASE:onenterAborted( Event, From, To )
function TASK:onenterAborted( Event, From, To )
self:E( "Task Aborted" )
@@ -910,11 +910,11 @@ function TASK_BASE:onenterAborted( Event, From, To )
end
--- FSM function for a TASK
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string Event
-- @param #string From
-- @param #string To
function TASK_BASE:onenterFailed( Event, From, To )
function TASK:onenterFailed( Event, From, To )
self:E( "Task Failed" )
@@ -924,11 +924,11 @@ function TASK_BASE:onenterFailed( Event, From, To )
end
--- FSM function for a TASK
-- @param #TASK_BASE self
-- @param #TASK self
-- @param #string Event
-- @param #string From
-- @param #string To
function TASK_BASE:onstatechange( Event, From, To )
function TASK:onstatechange( Event, From, To )
if self:IsTrace() then
MESSAGE:New( "@ Task " .. self.TaskName .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
@@ -948,9 +948,9 @@ do -- Reporting
--- Create a summary report of the Task.
-- List the Task Name and Status
-- @param #TASK_BASE self
-- @param #TASK self
-- @return #string
function TASK_BASE:ReportSummary()
function TASK:ReportSummary()
local Report = REPORT:New()
@@ -968,9 +968,9 @@ end
--- Create a detailed report of the Task.
-- List the Task Status, and the Players assigned to the Task.
-- @param #TASK_BASE self
-- @param #TASK self
-- @return #string
function TASK_BASE:ReportDetails()
function TASK:ReportDetails()
local Report = REPORT:New()

View File

@@ -47,7 +47,7 @@ end
--- StateMachine callback function for a TASK2
-- @param #TASK2_MENU_CLIENT self
-- @param Fsm.Fsm#FSM_TASK Fsm
-- @param Core.Fsm#FSM_TASK Fsm
-- @param #string Event
-- @param #string From
-- @param #string To
@@ -71,7 +71,7 @@ end
--- StateMachine callback function for a TASK2
-- @param #TASK2_MENU_CLIENT self
-- @param Fsm.Fsm#FSM_TASK Fsm
-- @param Core.Fsm#FSM_TASK Fsm
-- @param #string Event
-- @param #string From
-- @param #string To

View File

@@ -1,14 +1,14 @@
--- (AI) (SP) (MP) Tasking for Air to Ground Processes.
--
-- 1) @{#TASK_A2G} class, extends @{Tasking.Task#TASK_BASE}
-- 1) @{#TASK_A2G} class, extends @{Tasking.Task#TASK}
-- =================================================
-- The @{#TASK_A2G} class defines a CAS or BAI task of a @{Set} of Target Units,
-- located at a Target Zone, based on the tasking capabilities defined in @{Tasking.Task#TASK_BASE}.
-- located at a Target Zone, based on the tasking capabilities defined in @{Tasking.Task#TASK}.
-- The TASK_A2G is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
--
-- * **None**: Start of the process
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#FSM_ASSIGN_ACCEPT} is started to accept the task.
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#FSM_ROUTE} is started to route the active Units in the Group to the attack zone.
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#ACT_ASSIGN_ACCEPT} is started to accept the task.
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#ACT_ROUTE} is started to route the active Units in the Group to the attack zone.
-- * **Success**: The SEAD task is successfully completed. Upon Success, the sub-process @{Process_SEAD#PROCESS_SEAD} is started to follow-up successful SEADing of the targets assigned in the task.
-- * **Failed**: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
--
@@ -23,7 +23,7 @@ do -- TASK_A2G
--- The TASK_A2G class
-- @type TASK_A2G
-- @extends Tasking.Task#TASK_BASE
-- @extends Tasking.Task#TASK
TASK_A2G = {
ClassName = "TASK_A2G",
}
@@ -38,7 +38,7 @@ do -- TASK_A2G
-- @param Core.Zone#ZONE_BASE TargetZone
-- @return #TASK_A2G self
function TASK_A2G:New( Mission, SetGroup, TaskName, TaskType, TargetSetUnit, TargetZone, FACUnit )
local self = BASE:Inherit( self, TASK_BASE:New( Mission, SetGroup, TaskName, TaskType ) )
local self = BASE:Inherit( self, TASK:New( Mission, SetGroup, TaskName, TaskType ) )
self:F()
self.TargetSetUnit = TargetSetUnit
@@ -47,12 +47,12 @@ do -- TASK_A2G
local Fsm = self:GetUnitProcess()
Fsm:AddProcess( "Planned", "Accept", FSM_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } )
Fsm:AddProcess( "Assigned", "Route", FSM_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } )
Fsm:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } )
Fsm:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } )
Fsm:AddAction ( "Rejected", "Eject", "Planned" )
Fsm:AddAction ( "Arrived", "Update", "Updated" )
Fsm:AddProcess( "Updated", "Account", FSM_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } )
Fsm:AddProcess( "Updated", "Smoke", FSM_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) )
Fsm:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } )
Fsm:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) )
--Fsm:AddProcess( "Updated", "JTAC", PROCESS_JTAC:New( self, TaskUnit, self.TargetSetUnit, self.FACUnit ) )
Fsm:AddAction ( "Accounted", "Success", "Success" )
Fsm:AddAction ( "Failed", "Fail", "Failed" )

View File

@@ -2,11 +2,11 @@
--
-- ===
--
-- 1) @{Functional.AIBalancer#AIBALANCER} class, extends @{Core.Base#BASE}
-- 1) @{AI.AI_Balancer#AIBALANCER} class, extends @{Core.Base#BASE}
-- =======================================================
-- The @{Functional.AIBalancer#AIBALANCER} class controls the dynamic spawning of AI GROUPS depending on a SET_CLIENT.
-- The @{AI.AI_Balancer#AIBALANCER} class controls the dynamic spawning of AI GROUPS depending on a SET_CLIENT.
-- There will be as many AI GROUPS spawned as there at CLIENTS in SET_CLIENT not spawned.
-- The AIBalancer uses the @{PatrolCore.Zone#PATROLZONE} class to make AI patrol an zone until the fuel treshold is reached.
-- The AI_Balancer uses the @{PatrolCore.Zone#PATROLZONE} class to make AI patrol an zone until the fuel treshold is reached.
--
-- 1.1) AIBALANCER construction method:
-- ------------------------------------
@@ -23,7 +23,7 @@
--
-- 1.3) AIBALANCER allows AI to patrol specific zones:
-- ---------------------------------------------------
-- Use @{Functional.AIBalancer#AIBALANCER.SetPatrolZone}() to specify a zone where the AI needs to patrol.
-- Use @{AI.AI_Balancer#AIBALANCER.SetPatrolZone}() to specify a zone where the AI needs to patrol.
--
-- ===
--
@@ -61,7 +61,7 @@
--
-- * FlightControl: Framework Design & Programming
--
-- @module AIBalancer
-- @module AI_Balancer
@@ -157,7 +157,7 @@ function AIBALANCER:SetPatrolZone( PatrolZone, PatrolFloorAltitude, PatrolCeilin
)
end
--- Get the @{PatrolZone} object assigned by the @{AIBalancer} object.
--- Get the @{PatrolZone} object assigned by the @{AI_Balancer} object.
-- @param #AIBALANCER self
-- @return PatrolCore.Zone#PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol.
function AIBALANCER:GetPatrolZone()

View File

@@ -1,14 +1,14 @@
--- This module contains the TASK_PICKUP classes.
--
-- 1) @{#TASK_PICKUP} class, extends @{Tasking.Task#TASK_BASE}
-- 1) @{#TASK_PICKUP} class, extends @{Tasking.Task#TASK}
-- ===================================================
-- The @{#TASK_PICKUP} class defines a pickup task of a @{Set} of @{CARGO} objects defined within the mission.
-- based on the tasking capabilities defined in @{Tasking.Task#TASK_BASE}.
-- based on the tasking capabilities defined in @{Tasking.Task#TASK}.
-- The TASK_PICKUP is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
--
-- * **None**: Start of the process
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#FSM_ASSIGN_ACCEPT} is started to accept the task.
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#FSM_ROUTE} is started to route the active Units in the Group to the attack zone.
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#ACT_ASSIGN_ACCEPT} is started to accept the task.
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#ACT_ROUTE} is started to route the active Units in the Group to the attack zone.
-- * **Success**: The SEAD task is successfully completed. Upon Success, the sub-process @{Process_SEAD#PROCESS_SEAD} is started to follow-up successful SEADing of the targets assigned in the task.
-- * **Failed**: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
--
@@ -23,7 +23,7 @@ do -- TASK_PICKUP
--- The TASK_PICKUP class
-- @type TASK_PICKUP
-- @extends Tasking.Task#TASK_BASE
-- @extends Tasking.Task#TASK
TASK_PICKUP = {
ClassName = "TASK_PICKUP",
}
@@ -38,7 +38,7 @@ do -- TASK_PICKUP
-- @param Core.Zone#ZONE_BASE TargetZone
-- @return #TASK_PICKUP self
function TASK_PICKUP:New( Mission, AssignedSetGroup, TaskName, TaskType )
local self = BASE:Inherit( self, TASK_BASE:New( Mission, AssignedSetGroup, TaskName, TaskType, "PICKUP" ) )
local self = BASE:Inherit( self, TASK:New( Mission, AssignedSetGroup, TaskName, TaskType, "PICKUP" ) )
self:F()
_EVENTDISPATCHER:OnPlayerLeaveUnit( self._EventPlayerLeaveUnit, self )
@@ -67,7 +67,7 @@ do -- TASK_PICKUP
function TASK_PICKUP:AssignToUnit( TaskUnit )
self:F( TaskUnit:GetName() )
local ProcessAssign = self:AddProcess( TaskUnit, FSM_ASSIGN_ACCEPT:New( self, TaskUnit, self.TaskBriefing ) )
local ProcessAssign = self:AddProcess( TaskUnit, ACT_ASSIGN_ACCEPT:New( self, TaskUnit, self.TaskBriefing ) )
local ProcessPickup = self:AddProcess( TaskUnit, PROCESS_PICKUP:New( self, self.TaskType, TaskUnit ) )
local Process = self:AddStateMachine( TaskUnit, FSM_TASK:New( self, TaskUnit, {
@@ -98,7 +98,7 @@ do -- TASK_PICKUP
--- StateMachine callback function for a TASK
-- @param #TASK_PICKUP self
-- @param Fsm.Fsm#FSM_TASK Fsm
-- @param Core.Fsm#FSM_TASK Fsm
-- @param #string Event
-- @param #string From
-- @param #string To

View File

@@ -1,14 +1,14 @@
--- This module contains the TASK_SEAD classes.
--
-- 1) @{#TASK_SEAD} class, extends @{Tasking.Task#TASK_BASE}
-- 1) @{#TASK_SEAD} class, extends @{Tasking.Task#TASK}
-- =================================================
-- The @{#TASK_SEAD} class defines a SEAD task for a @{Set} of Target Units, located at a Target Zone,
-- based on the tasking capabilities defined in @{Tasking.Task#TASK_BASE}.
-- based on the tasking capabilities defined in @{Tasking.Task#TASK}.
-- The TASK_SEAD is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
--
-- * **None**: Start of the process
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#FSM_ASSIGN_ACCEPT} is started to accept the task.
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#FSM_ROUTE} is started to route the active Units in the Group to the attack zone.
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#ACT_ASSIGN_ACCEPT} is started to accept the task.
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#ACT_ROUTE} is started to route the active Units in the Group to the attack zone.
-- * **Success**: The SEAD task is successfully completed. Upon Success, the sub-process @{Process_SEAD#PROCESS_SEAD} is started to follow-up successful SEADing of the targets assigned in the task.
-- * **Failed**: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
--
@@ -25,7 +25,7 @@ do -- TASK_SEAD
--- The TASK_SEAD class
-- @type TASK_SEAD
-- @field Set#SET_UNIT TargetSetUnit
-- @extends Tasking.Task#TASK_BASE
-- @extends Tasking.Task#TASK
TASK_SEAD = {
ClassName = "TASK_SEAD",
}
@@ -39,7 +39,7 @@ do -- TASK_SEAD
-- @param Core.Zone#ZONE_BASE TargetZone
-- @return #TASK_SEAD self
function TASK_SEAD:New( Mission, SetGroup, TaskName, TargetSetUnit, TargetZone )
local self = BASE:Inherit( self, TASK_BASE:New( Mission, SetGroup, TaskName, "SEAD" ) ) -- Tasking.Task_SEAD#TASK_SEAD
local self = BASE:Inherit( self, TASK:New( Mission, SetGroup, TaskName, "SEAD" ) ) -- Tasking.Task_SEAD#TASK_SEAD
self:F()
self.TargetSetUnit = TargetSetUnit
@@ -47,12 +47,12 @@ do -- TASK_SEAD
local Fsm = self:GetUnitProcess()
Fsm:AddProcess( "Planned", "Accept", FSM_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } )
Fsm:AddProcess( "Assigned", "Route", FSM_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } )
Fsm:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } )
Fsm:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } )
Fsm:AddAction ( "Rejected", "Eject", "Planned" )
Fsm:AddAction ( "Arrived", "Update", "Updated" )
Fsm:AddProcess( "Updated", "Account", FSM_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } )
Fsm:AddProcess( "Updated", "Smoke", FSM_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) )
Fsm:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } )
Fsm:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) )
Fsm:AddAction ( "Accounted", "Success", "Success" )
Fsm:AddAction ( "Failed", "Fail", "Failed" )