mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-17 03:11:28 +00:00
Ops
This commit is contained in:
@@ -327,12 +327,11 @@ function AIRWING:FetchPayloadFromStock(UnitType, MissionType)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
self:I(self.lid..string.format("Looking for payload for unit type=%s and mission type=%s", UnitType, MissionType))
|
||||||
for i,_payload in pairs(self.payloads) do
|
for i,_payload in pairs(self.payloads) do
|
||||||
local payload=_payload --#AIRWING.Payload
|
local payload=_payload --#AIRWING.Payload
|
||||||
self:I(self.lid..string.format("%d Payload type=%s navail=%d", i, payload.aircrafttype, payload.navail))
|
self:I(self.lid..string.format("[%d] Payload type=%s navail=%d unlimited=%s", i, payload.aircrafttype, payload.navail, tostring(payload.unlimited)))
|
||||||
end
|
end
|
||||||
]]
|
|
||||||
|
|
||||||
--- Sort payload wrt the following criteria:
|
--- Sort payload wrt the following criteria:
|
||||||
-- 1) Highest performance is the main selection criterion.
|
-- 1) Highest performance is the main selection criterion.
|
||||||
@@ -346,13 +345,16 @@ function AIRWING:FetchPayloadFromStock(UnitType, MissionType)
|
|||||||
local performanceB=self:GetPayloadPeformance(b, MissionType)
|
local performanceB=self:GetPayloadPeformance(b, MissionType)
|
||||||
return (performanceA>performanceB) or (performanceA==performanceB and a.unlimited==true) or (performanceA==performanceB and a.unlimited==true and b.unlimited==true and a.navail>b.navail)
|
return (performanceA>performanceB) or (performanceA==performanceB and a.unlimited==true) or (performanceA==performanceB and a.unlimited==true and b.unlimited==true and a.navail>b.navail)
|
||||||
elseif not a then
|
elseif not a then
|
||||||
|
env.info("FF ERROR in sortpayloads: a is nil")
|
||||||
return false
|
return false
|
||||||
elseif not b then
|
elseif not b then
|
||||||
|
env.info("FF ERROR in sortpayloads: b is nil")
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return true
|
env.info("FF ERROR in sortpayloads: a and b are nil")
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.sort(self.payloads, sortpayloads)
|
table.sort(self.payloads, sortpayloads)
|
||||||
|
|
||||||
if self.Debug then
|
if self.Debug then
|
||||||
|
|||||||
@@ -114,7 +114,12 @@
|
|||||||
-- # The AUFTRAG Concept
|
-- # The AUFTRAG Concept
|
||||||
--
|
--
|
||||||
-- As you probably know, setting tasks in DCS is often tedious. The AUFTRAG class significantly simplifies the necessary workflow by using optimized default parameters.
|
-- As you probably know, setting tasks in DCS is often tedious. The AUFTRAG class significantly simplifies the necessary workflow by using optimized default parameters.
|
||||||
-- Also, a lot of additional useful events are created.
|
--
|
||||||
|
-- You can think of an AUFTRAG as document, which contains the mission briefing, i.e. information about the target location, mission altitude, speed and various other parameters.
|
||||||
|
-- This document can be handed over directly to a pilot (or multiple pilots) via the
|
||||||
|
-- FLIGHTGROUP class. The pilots will then execute the mission. The AUFTRAG document can also be given to an AIRWING. The airwing will then determine the best assets
|
||||||
|
-- (pilots and payloads) available for the job. One more up the food chain, an AUFTRAG can be passed to a WINGCOMMANDER. The wing commander will find the best AIRWING
|
||||||
|
-- and pass the job over to it.
|
||||||
--
|
--
|
||||||
-- # Mission Types
|
-- # Mission Types
|
||||||
--
|
--
|
||||||
|
|||||||
Reference in New Issue
Block a user