mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Updates
This commit is contained in:
parent
5486a12c77
commit
4c8f920c61
@ -12,7 +12,7 @@
|
||||
--
|
||||
-- 1.1) Add or remove objects from the FSM
|
||||
-- --------------------------------------------
|
||||
-- @module StateMachine
|
||||
-- @module Fsm
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
@ -346,23 +346,23 @@ end
|
||||
|
||||
|
||||
|
||||
--- STATEMACHINE_CONTROLLABLE class
|
||||
-- @type STATEMACHINE_CONTROLLABLE
|
||||
--- FSM_CONTROLLABLE class
|
||||
-- @type FSM_CONTROLLABLE
|
||||
-- @field Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @extends Fsm.Fsm#FSM
|
||||
STATEMACHINE_CONTROLLABLE = {
|
||||
ClassName = "STATEMACHINE_CONTROLLABLE",
|
||||
FSM_CONTROLLABLE = {
|
||||
ClassName = "FSM_CONTROLLABLE",
|
||||
}
|
||||
|
||||
--- Creates a new STATEMACHINE_CONTROLLABLE object.
|
||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
||||
--- Creates a new FSM_CONTROLLABLE object.
|
||||
-- @param #FSM_CONTROLLABLE self
|
||||
-- @param #table FSMT Finite State Machine Table
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable (optional) The CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
||||
-- @return #STATEMACHINE_CONTROLLABLE
|
||||
function STATEMACHINE_CONTROLLABLE:New( FSMT, Controllable )
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable (optional) The CONTROLLABLE object that the FSM_CONTROLLABLE governs.
|
||||
-- @return #FSM_CONTROLLABLE
|
||||
function FSM_CONTROLLABLE:New( FSMT, Controllable )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, FSM:New( FSMT ) ) -- Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
||||
local self = BASE:Inherit( self, FSM:New( FSMT ) ) -- Fsm.Fsm#FSM_CONTROLLABLE
|
||||
|
||||
if Controllable then
|
||||
self:SetControllable( Controllable )
|
||||
@ -371,23 +371,23 @@ function STATEMACHINE_CONTROLLABLE:New( FSMT, Controllable )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Sets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
||||
--- Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.
|
||||
-- @param #FSM_CONTROLLABLE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE FSMControllable
|
||||
-- @return #STATEMACHINE_CONTROLLABLE
|
||||
function STATEMACHINE_CONTROLLABLE:SetControllable( FSMControllable )
|
||||
-- @return #FSM_CONTROLLABLE
|
||||
function FSM_CONTROLLABLE:SetControllable( FSMControllable )
|
||||
self:F( FSMControllable )
|
||||
self.Controllable = FSMControllable
|
||||
end
|
||||
|
||||
--- Gets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
||||
--- Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.
|
||||
-- @param #FSM_CONTROLLABLE self
|
||||
-- @return Wrapper.Controllable#CONTROLLABLE
|
||||
function STATEMACHINE_CONTROLLABLE:GetControllable()
|
||||
function FSM_CONTROLLABLE:GetControllable()
|
||||
return self.Controllable
|
||||
end
|
||||
|
||||
function STATEMACHINE_CONTROLLABLE:_call_handler( handler, params )
|
||||
function FSM_CONTROLLABLE:_call_handler( handler, params )
|
||||
|
||||
local ErrorHandler = function( errmsg )
|
||||
|
||||
@ -409,7 +409,7 @@ end
|
||||
--- FSM_PROCESS class
|
||||
-- @type FSM_PROCESS
|
||||
-- @field Tasking.Task#TASK_BASE Task
|
||||
-- @extends Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
||||
-- @extends Fsm.Fsm#FSM_CONTROLLABLE
|
||||
FSM_PROCESS = {
|
||||
ClassName = "FSM_PROCESS",
|
||||
}
|
||||
@ -419,7 +419,7 @@ FSM_PROCESS = {
|
||||
-- @return #FSM_PROCESS
|
||||
function FSM_PROCESS:New( FsmT, Controllable, Task )
|
||||
|
||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FsmT ) ) -- Fsm.Fsm#FSM_PROCESS
|
||||
local self = BASE:Inherit( self, FSM_CONTROLLABLE:New( FsmT ) ) -- Fsm.Fsm#FSM_PROCESS
|
||||
|
||||
self:Assign( Controllable, Task )
|
||||
self.ClassName = FsmT._Name
|
||||
@ -566,7 +566,7 @@ FSM_TASK = {
|
||||
-- @return #FSM_TASK
|
||||
function FSM_TASK:New( FSMT )
|
||||
|
||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FSMT ) ) -- Fsm.Fsm#FSM_TASK
|
||||
local self = BASE:Inherit( self, FSM_CONTROLLABLE:New( FSMT ) ) -- Fsm.Fsm#FSM_TASK
|
||||
|
||||
self["onstatechange"] = self.OnStateChange
|
||||
|
||||
|
||||
@ -155,7 +155,7 @@
|
||||
-- @field Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @field Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
||||
-- @field Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||
-- @extends Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
||||
-- @extends Fsm.Fsm#FSM_CONTROLLABLE
|
||||
PATROLZONE = {
|
||||
ClassName = "PATROLZONE",
|
||||
}
|
||||
@ -190,7 +190,7 @@ function PATROLZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude,
|
||||
}
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FSMT ) )
|
||||
local self = BASE:Inherit( self, FSM_CONTROLLABLE:New( FSMT ) )
|
||||
|
||||
self.PatrolZone = PatrolZone
|
||||
self.PatrolFloorAltitude = PatrolFloorAltitude
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
-- @field Wrapper.Group#GROUP ProcessGroup
|
||||
-- @field Core.Menu#MENU_GROUP MissionMenu
|
||||
-- @field #string ProcessName
|
||||
-- @extends Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
||||
-- @extends Fsm.Fsm#FSM_CONTROLLABLE
|
||||
PROCESS = {
|
||||
ClassName = "PROCESS",
|
||||
NextEvent = nil,
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
-- * @{#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 @{StateMachine} to a task.
|
||||
-- * @{#TASK_BASE.RemoveStateMachine}():Remove @{StateMachine} from a task.
|
||||
-- * @{#TASK_BASE.HasStateMachine}():Enquire if the task has a @{StateMachine}
|
||||
-- * @{#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.
|
||||
--
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user