mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-24 12:05:27 +00:00
Refactoring
This commit is contained in:
@@ -258,12 +258,6 @@ function FLIGHTGROUP:New(groupname, autostart)
|
||||
self.flaghold=USERFLAG:New(string.format("%s_FlagHold", self.groupname))
|
||||
self.flaghold:Set(0)
|
||||
|
||||
-- Init waypoints.
|
||||
self:InitWaypoints()
|
||||
|
||||
-- Initialize group.
|
||||
self:_InitGroup()
|
||||
|
||||
-- Add FSM transitions.
|
||||
-- From State --> Event --> To State
|
||||
self:AddTransition("*", "RTB", "Inbound") -- Group is returning to destination base.
|
||||
@@ -345,6 +339,12 @@ function FLIGHTGROUP:New(groupname, autostart)
|
||||
self:HandleEvent(EVENTS.Crash, self.OnEventCrash)
|
||||
self:HandleEvent(EVENTS.RemoveUnit, self.OnEventRemoveUnit)
|
||||
|
||||
-- Init waypoints.
|
||||
self:InitWaypoints()
|
||||
|
||||
-- Initialize group.
|
||||
self:_InitGroup()
|
||||
|
||||
-- Start the status monitoring.
|
||||
self:__CheckZone(-1)
|
||||
self:__Status(-2)
|
||||
@@ -2617,6 +2617,10 @@ function FLIGHTGROUP:AddElementByName(unitname)
|
||||
-- Add element to table.
|
||||
table.insert(self.elements, element)
|
||||
|
||||
if unit:IsAlive() then
|
||||
self:ElementSpawned(element)
|
||||
end
|
||||
|
||||
return element
|
||||
end
|
||||
|
||||
|
||||
@@ -67,12 +67,6 @@ function NAVYGROUP:New(GroupName)
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("NAVYGROUP %s | ", self.groupname)
|
||||
|
||||
-- Init waypoints.
|
||||
self:InitWaypoints()
|
||||
|
||||
-- Initialize the group.
|
||||
self:_InitGroup()
|
||||
|
||||
-- Defaults
|
||||
self:SetDefaultROE()
|
||||
self:SetDetection()
|
||||
@@ -100,6 +94,13 @@ function NAVYGROUP:New(GroupName)
|
||||
|
||||
-- TODO: Add pseudo functions.
|
||||
|
||||
|
||||
-- Init waypoints.
|
||||
self:InitWaypoints()
|
||||
|
||||
-- Initialize the group.
|
||||
self:_InitGroup()
|
||||
|
||||
-- Debug trace.
|
||||
if false then
|
||||
self.Debug=true
|
||||
|
||||
Reference in New Issue
Block a user