Worked on DCS function prototyping

Found in LDT the means to create using luadoc function prototypes using
a documentation mechanism. Am reworking now the DCS function manual to a
luadoc structure.
This commit is contained in:
FlightControl
2016-03-24 11:00:49 +01:00
parent 11c7cea1de
commit 560e3d643f
20 changed files with 1381 additions and 91 deletions

View File

@@ -5287,7 +5287,7 @@ function CARGO_GROUP:Spawn( Client )
elseif self:IsStatusLoading() then
local Client = self:IsLoadingToClient()
if Client and Client:ClientGroup() then
if Client and Client:GetDCSGroup() then
SpawnCargo = false
else
local CargoGroup = Group.getByName( self.CargoName )
@@ -5301,7 +5301,7 @@ function CARGO_GROUP:Spawn( Client )
local ClientLoaded = self:IsLoadedInClient()
-- Now test if another Client is alive (not this one), and it has the CARGO, then this cargo does not need to be initialized and spawned.
if ClientLoaded and ClientLoaded ~= Client then
local ClientGroup = Client:ClientGroup()
local ClientGroup = Client:GetDCSGroup()
if ClientLoaded:GetClientGroupDCSUnit() and ClientLoaded:GetClientGroupDCSUnit():isExist() then
SpawnCargo = false
else
@@ -5487,7 +5487,7 @@ function CARGO_PACKAGE:Spawn( Client )
-- this needs to be checked thoroughly
local CargoClientGroup = self.CargoClient:ClientGroup()
local CargoClientGroup = self.CargoClient:GetDCSGroup()
if not CargoClientGroup then
if not self.CargoClientSpawn then
self.CargoClientSpawn = SPAWN:New( self.CargoClient:GetClientGroupName() ):Limit( 1, 1 )
@@ -5502,7 +5502,7 @@ function CARGO_PACKAGE:Spawn( Client )
elseif self:IsStatusLoading() or self:IsStatusLoaded() then
local CargoClientLoaded = self:IsLoadedInClient()
if CargoClientLoaded and CargoClientLoaded:ClientGroup() then
if CargoClientLoaded and CargoClientLoaded:GetDCSGroup() then
SpawnCargo = false
end
@@ -5527,7 +5527,7 @@ self:T()
local Near = false
if self.CargoClient and self.CargoClient:ClientGroup() then
if self.CargoClient and self.CargoClient:GetDCSGroup() then
self:T( self.CargoClient.ClientName )
self:T( 'Client Exists.' )
@@ -5553,8 +5553,8 @@ self:T()
local CarrierPosOnBoard = ClientUnit:getPoint()
local CarrierPosMoveAway = ClientUnit:getPoint()
local CargoHostGroup = self.CargoClient:ClientGroup()
local CargoHostName = self.CargoClient:ClientGroup():getName()
local CargoHostGroup = self.CargoClient:GetDCSGroup()
local CargoHostName = self.CargoClient:GetDCSGroup():getName()
local CargoHostUnits = CargoHostGroup:getUnits()
local CargoPos = CargoHostUnits[1]:getPoint()
@@ -5637,7 +5637,7 @@ self:T()
local OnBoarded = false
if self.CargoClient and self.CargoClient:ClientGroup() then
if self.CargoClient and self.CargoClient:GetDCSGroup() then
if routines.IsUnitInRadius( self.CargoClient:GetClientGroupDCSUnit(), self.CargoClient:ClientPosition(), 10 ) then
-- Switch Cargo from self.CargoClient to Client ... Each cargo can have only one client. So assigning the new client for the cargo is enough.
@@ -5658,7 +5658,7 @@ self:T()
self:T( 'self.CargoName = ' .. self.CargoName )
--self:T( 'self.CargoHostName = ' .. self.CargoHostName )
--self.CargoSpawn:FromCarrier( Client:ClientGroup(), TargetZoneName, self.CargoHostName )
--self.CargoSpawn:FromCarrier( Client:GetDCSGroup(), TargetZoneName, self.CargoHostName )
self:StatusUnLoaded()
return Cargo
@@ -5883,7 +5883,7 @@ end
--- ClientGroup returns the Group of a Client.
-- This function is modified to deal with a couple of bugs in DCS 1.5.3
-- @return Group
function CLIENT:ClientGroup()
function CLIENT:GetDCSGroup()
--self:T()
-- local ClientData = Group.getByName( self.ClientName )
@@ -5955,7 +5955,7 @@ end
function CLIENT:GetClientGroupID()
self:T()
ClientGroup = self:ClientGroup()
ClientGroup = self:GetDCSGroup()
if ClientGroup then
if ClientGroup:isExist() then
@@ -5972,7 +5972,7 @@ end
function CLIENT:GetClientGroupName()
self:T()
ClientGroup = self:ClientGroup()
ClientGroup = self:GetDCSGroup()
if ClientGroup then
if ClientGroup:isExist() then
@@ -5992,7 +5992,7 @@ end
function CLIENT:GetClientGroupUnit()
self:T()
local ClientGroup = self:ClientGroup()
local ClientGroup = self:GetDCSGroup()
if ClientGroup then
if ClientGroup:isExist() then
@@ -6010,7 +6010,7 @@ end
function CLIENT:GetClientGroupDCSUnit()
self:T()
local ClientGroup = self:ClientGroup()
local ClientGroup = self:GetDCSGroup()
if ClientGroup then
if ClientGroup:isExist() then
@@ -8483,7 +8483,7 @@ function MISSION:ReportToAll()
local AlivePlayers = ''
for ClientID, Client in pairs( self._Clients ) do
if Client:ClientGroup() then
if Client:GetDCSGroup() then
if Client:GetClientGroupDCSUnit() then
if Client:GetClientGroupDCSUnit():getLife() > 0.0 then
if AlivePlayers == '' then
@@ -8716,7 +8716,7 @@ trace.scheduled("MISSIONSCHEDULER","Scheduler")
trace.i( "MISSIONSCHEDULER", "Client: " .. Client.ClientName )
if Client:ClientGroup() then
if Client:GetDCSGroup() then
-- There is at least one Client that is alive... So the Mission status is set to Ongoing.
ClientsAlive = true