mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
STATEMACHINE_TEMPLATE is added to template statemachines...
It is working now, and NOW SWITCHING SLOTS of PLAYERS ALSO WORKS IN TASKING!!! Jippie!!! The next thing is to debug the DETECTION_DISPATCHER... And make STATEMACHINE_TEMPLATE now as a parameter to create new STATEMACHINEs, instead of that ugly table construction. The, I need to modify the New: Methods of each STATEMACHINE_PROCESS to be initialized with a TEMPLATE... Maybe I can commit already and just implement this later ...
This commit is contained in:
@@ -178,7 +178,7 @@ do -- PROCESS_ACCOUNT_DEADS
|
||||
-- @param Set#SET_UNIT TargetSetUnit
|
||||
-- @param #string TaskName
|
||||
function PROCESS_ACCOUNT_DEADS:Template( TargetSetUnit, TaskName )
|
||||
return { self, arg }
|
||||
return { self, { TargetSetUnit, TaskName } }
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ do -- PROCESS_ASSIGN
|
||||
|
||||
--- PROCESS_ASSIGN class
|
||||
-- @type PROCESS_ASSIGN
|
||||
-- @field Task#TASK_BASE Task
|
||||
-- @field Tasking.Task#TASK_BASE Task
|
||||
-- @field Unit#UNIT ProcessUnit
|
||||
-- @field Zone#ZONE_BASE TargetZone
|
||||
-- @extends Fsm.Process#PROCESS
|
||||
@@ -128,7 +128,7 @@ do -- PROCESS_ASSIGN_ACCEPT
|
||||
-- @field Task#TASK_BASE Task
|
||||
-- @field Unit#UNIT ProcessUnit
|
||||
-- @field Zone#ZONE_BASE TargetZone
|
||||
-- @extends Process#PROCESS
|
||||
-- @extends Fsm.Process#PROCESS
|
||||
PROCESS_ASSIGN_ACCEPT = {
|
||||
ClassName = "PROCESS_ASSIGN_ACCEPT",
|
||||
}
|
||||
@@ -159,17 +159,34 @@ do -- PROCESS_ASSIGN_ACCEPT
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ASSIGN_ACCEPT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function PROCESS_ASSIGN_ACCEPT:onafterStart( ProcessUnit, Event, From, To )
|
||||
self:E( { ProcessUnit, Event, From, To } )
|
||||
|
||||
MESSAGE:New( self.TaskBriefing, 30, "Task Assignment" ):ToGroup( ProcessUnit:GetGroup() )
|
||||
local ProcessGroup = ProcessUnit:GetGroup()
|
||||
MESSAGE:New( self.TaskBriefing, 30, ProcessUnit:GetPlayerName() .. " Task Acceptance" ):ToGroup( ProcessGroup )
|
||||
|
||||
self:__Assign( 1 )
|
||||
end
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ASSIGN_ACCEPT self
|
||||
-- @param Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function PROCESS_ASSIGN_ACCEPT:onenterAssigned( ProcessUnit, Event, From, To )
|
||||
self:E( { ProcessUnit, Event, From, To } )
|
||||
|
||||
local ProcessGroup = ProcessUnit:GetGroup()
|
||||
|
||||
MESSAGE:New( "You are assigned to the task " .. self.Task:GetName(), 30, ProcessUnit:GetPlayerName() .. ": Task Assignment" ):ToGroup( ProcessGroup )
|
||||
|
||||
self.Task:Assign()
|
||||
end
|
||||
|
||||
end -- PROCESS_ASSIGN_ACCEPT
|
||||
|
||||
@@ -185,6 +202,16 @@ do -- PROCESS_ASSIGN_MENU_ACCEPT
|
||||
PROCESS_ASSIGN_MENU_ACCEPT = {
|
||||
ClassName = "PROCESS_ASSIGN_MENU_ACCEPT",
|
||||
}
|
||||
|
||||
--- Init.
|
||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||
-- @param #string TaskName
|
||||
-- @param #string TaskBriefing
|
||||
-- @return #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||
function PROCESS_ASSIGN_MENU_ACCEPT:Template( TaskName, TaskBriefing )
|
||||
|
||||
return { self, { TaskName, TaskBriefing } }
|
||||
end
|
||||
|
||||
|
||||
--- Creates a new task assignment state machine. The process will request from the menu if it accepts the task, if not, the unit is removed from the simulator.
|
||||
|
||||
@@ -200,7 +200,7 @@ do -- PROCESS_ROUTE_ZONE
|
||||
-- @param #PROCESS_ROUTE_ZONE self
|
||||
-- @param Zone#ZONE_BASE TargetZone
|
||||
function PROCESS_ROUTE_ZONE:Template( TargetZone )
|
||||
return { self, arg }
|
||||
return { self, { TargetZone } }
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ do -- PROCESS_SMOKE_TARGETS_ZONE
|
||||
-- @param Set#SET_UNIT TargetSetUnit
|
||||
-- @param Zone#ZONE_BASE TargetZone
|
||||
function PROCESS_SMOKE_TARGETS_ZONE:Template( TargetSetUnit, TargetZone )
|
||||
return { self, arg }
|
||||
return { self, { TargetSetUnit, TargetZone } }
|
||||
end
|
||||
|
||||
--- Creates a new target smoking state machine. The process will request from the menu if it accepts the task, if not, the unit is removed from the simulator.
|
||||
|
||||
Reference in New Issue
Block a user