FSM restructuring

This commit is contained in:
FlightControl
2016-12-06 10:30:05 +01:00
parent 0a4630bde6
commit e46d7be91b
11 changed files with 210 additions and 210 deletions

View File

@@ -7,8 +7,8 @@
-- 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#PROCESS_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#PROCESS_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#FSMT_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#FSMT_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.
--
@@ -47,12 +47,12 @@ do -- TASK_A2G
local Fsm = self:GetFsmTemplate()
Fsm:AddProcess( "Planned", "Accept", PROCESS_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } )
Fsm:AddProcess( "Assigned", "Route", PROCESS_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } )
Fsm:AddProcess( "Planned", "Accept", FSMT_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } )
Fsm:AddProcess( "Assigned", "Route", FSMT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } )
Fsm:AddAction ( "Rejected", "Eject", "Planned" )
Fsm:AddAction ( "Arrived", "Update", "Updated" )
Fsm:AddProcess( "Updated", "Account", PROCESS_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } )
Fsm:AddProcess( "Updated", "Smoke", PROCESS_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) )
Fsm:AddProcess( "Updated", "Account", FSMT_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } )
Fsm:AddProcess( "Updated", "Smoke", FSMT_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

@@ -7,8 +7,8 @@
-- 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#PROCESS_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#PROCESS_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#FSMT_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#FSMT_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.
--
@@ -67,7 +67,7 @@ do -- TASK_PICKUP
function TASK_PICKUP:AssignToUnit( TaskUnit )
self:F( TaskUnit:GetName() )
local ProcessAssign = self:AddProcess( TaskUnit, PROCESS_ASSIGN_ACCEPT:New( self, TaskUnit, self.TaskBriefing ) )
local ProcessAssign = self:AddProcess( TaskUnit, FSMT_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, {

View File

@@ -7,8 +7,8 @@
-- 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#PROCESS_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#PROCESS_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#FSMT_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#FSMT_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.
--
@@ -47,12 +47,12 @@ do -- TASK_SEAD
local Fsm = self:GetFsmTemplate()
Fsm:AddProcess( "Planned", "Accept", PROCESS_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } )
Fsm:AddProcess( "Assigned", "Route", PROCESS_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } )
Fsm:AddProcess( "Planned", "Accept", FSMT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } )
Fsm:AddProcess( "Assigned", "Route", FSMT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } )
Fsm:AddAction ( "Rejected", "Eject", "Planned" )
Fsm:AddAction ( "Arrived", "Update", "Updated" )
Fsm:AddProcess( "Updated", "Account", PROCESS_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } )
Fsm:AddProcess( "Updated", "Smoke", PROCESS_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) )
Fsm:AddProcess( "Updated", "Account", FSMT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } )
Fsm:AddProcess( "Updated", "Smoke", FSMT_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) )
Fsm:AddAction ( "Accounted", "Success", "Success" )
Fsm:AddAction ( "Failed", "Fail", "Failed" )