diff --git a/Moose Development/Moose/Airbase.lua b/Moose Development/Moose/Airbase.lua index 15c4fc7d5..8d695872e 100644 --- a/Moose Development/Moose/Airbase.lua +++ b/Moose Development/Moose/Airbase.lua @@ -95,7 +95,7 @@ function AIRBASE:FindByName( AirbaseName ) return AirbaseFound end -function AIRBASE:GetDCSAirbase() +function AIRBASE:GetDCSObject() local DCSAirbase = Airbase.getByName( self.AirbaseName ) if DCSAirbase then @@ -105,202 +105,5 @@ function AIRBASE:GetDCSAirbase() return nil end ---- Returns coalition of the Airbase. --- @param Airbase#AIRBASE self --- @return DCSCoalitionObject#coalition.side The side of the coalition. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetCoalition() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCoalition = DCSAirbase:getCoalition() - self:T3( AirbaseCoalition ) - return AirbaseCoalition - end - - return nil -end - ---- Returns country of the Airbase. --- @param Airbase#AIRBASE self --- @return DCScountry#country.id The country identifier. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetCountry() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCountry = DCSAirbase:getCountry() - self:T3( AirbaseCountry ) - return AirbaseCountry - end - - return nil -end - - ---- Returns DCS Airbase object name. --- The function provides access to non-activated units too. --- @param Airbase#AIRBASE self --- @return #string The name of the DCS Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetName() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseName = self.AirbaseName - return AirbaseName - end - - return nil -end - - ---- Returns if the airbase is alive. --- @param Airbase#AIRBASE self --- @return #boolean true if Airbase is alive. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:IsAlive() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseIsAlive = DCSAirbase:isExist() - return AirbaseIsAlive - end - - return false -end - ---- Returns the unit's unique identifier. --- @param Airbase#AIRBASE self --- @return DCSAirbase#Airbase.ID Airbase ID --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetID() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseID = DCSAirbase:getID() - return AirbaseID - end - - return nil -end - ---- Returns the Airbase's callsign - the localized string. --- @param Airbase#AIRBASE self --- @return #string The Callsign of the Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetCallSign() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCallSign = DCSAirbase:getCallsign() - return AirbaseCallSign - end - - return nil -end - - - ---- Returns unit descriptor. Descriptor type depends on unit category. --- @param Airbase#AIRBASE self --- @return DCSAirbase#Airbase.Desc The Airbase descriptor. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetDesc() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseDesc = DCSAirbase:getDesc() - return AirbaseDesc - end - - return nil -end - - ---- Returns the type name of the DCS Airbase. --- @param Airbase#AIRBASE self --- @return #string The type name of the DCS Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetTypeName() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseTypeName = DCSAirbase:getTypeName() - self:T3( AirbaseTypeName ) - return AirbaseTypeName - end - - return nil -end - - ---- Returns the @{DCSTypes#Vec2} vector indicating the point in 2D of the DCS Airbase within the mission. --- @param Airbase#AIRBASE self --- @return DCSTypes#Vec2 The 2D point vector of the DCS Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetPointVec2() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbasePointVec3 = DCSAirbase:getPosition().p - - local AirbasePointVec2 = {} - AirbasePointVec2.x = AirbasePointVec3.x - AirbasePointVec2.y = AirbasePointVec3.z - - self:T3( AirbasePointVec2 ) - return AirbasePointVec2 - end - - return nil -end - ---- Returns the DCS Airbase category as defined within the DCS Airbase Descriptor. --- @param Airbase#AIRBASE self --- @return DCSAirbase#Airbase.Category The DCS Airbase Category -function AIRBASE:GetCategory() - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCategory = self:GetDesc().category - return AirbaseCategory - end - - return nil -end - - ---- Returns the DCS Airbase category name as defined within the DCS Airbase Descriptor. --- @param Airbase#AIRBASE self --- @return #string The DCS Airbase Category Name -function AIRBASE:GetCategoryName() - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCategoryName = self.CategoryName[ self:GetDesc().category ] - return AirbaseCategoryName - end - - return nil -end diff --git a/Moose Development/Moose/Identifiable.lua b/Moose Development/Moose/Identifiable.lua index 82ca95e15..cc12bdbb4 100644 --- a/Moose Development/Moose/Identifiable.lua +++ b/Moose Development/Moose/Identifiable.lua @@ -53,7 +53,7 @@ local _CategoryName = { -- @param DCSIdentifiable#Identifiable IdentifiableName The DCS Identifiable name -- @return #IDENTIFIABLE self function IDENTIFIABLE:New( IdentifiableName ) - local self = BASE:Inherit( self, BASE:New() ) + local self = BASE:Inherit( self, OBJECT:New( IdentifiableName ) ) self:F2( IdentifiableName ) self.IdentifiableName = IdentifiableName return self @@ -119,6 +119,21 @@ function IDENTIFIABLE:GetTypeName() end +--- Returns category of the DCS Identifiable. +-- @param #IDENTIFIABLE self +-- @return DCSObject#Object.Category The category ID +function IDENTIFIABLE:GetCategory() + self:F2( self.ObjectName ) + + local DCSObject = self:GetDCSObject() + if DCSObject then + local ObjectCategory = DCSObject:getCategory() + self:T3( ObjectCategory ) + return ObjectCategory + end + + return nil +end --- Returns the DCS Identifiable category name as defined within the DCS Identifiable Descriptor. diff --git a/Moose Development/Moose/Object.lua b/Moose Development/Moose/Object.lua index 05b8e2855..1a5ac146c 100644 --- a/Moose Development/Moose/Object.lua +++ b/Moose Development/Moose/Object.lua @@ -51,163 +51,22 @@ function OBJECT:New( ObjectName ) end ---- Returns if the Object is alive. +--- Returns the unit's unique identifier. -- @param Object#OBJECT self --- @return #boolean true if Object is alive. +-- @return DCSObject#Object.ID ObjectID -- @return #nil The DCS Object is not existing or alive. -function OBJECT:IsAlive() +function OBJECT:GetID() self:F2( self.ObjectName ) local DCSObject = self:GetDCSObject() if DCSObject then - local ObjectIsAlive = DCSObject:isExist() - return ObjectIsAlive + local ObjectID = DCSObject:getID() + return ObjectID end - - return false -end - - - ---- Returns DCS Object object name. --- The function provides access to non-activated objects too. --- @param Object#OBJECT self --- @return #string The name of the DCS Object. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetName() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectName = self.ObjectName - return ObjectName - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - - ---- Returns the type name of the DCS Object. --- @param Object#OBJECT self --- @return #string The type name of the DCS Object. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetTypeName() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectTypeName = DCSObject:getTypeName() - self:T3( ObjectTypeName ) - return ObjectTypeName - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - ---- Returns the Object's callsign - the localized string. --- @param Object#OBJECT self --- @return #string The Callsign of the Object. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetCallSign() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCallSign = DCSObject:getCallsign() - return ObjectCallSign - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - - ---- Returns the DCS Object category name as defined within the DCS Object Descriptor. --- @param Object#OBJECT self --- @return #string The DCS Object Category Name -function OBJECT:GetCategoryName() - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCategoryName = _CategoryName[ self:GetDesc().category ] - return ObjectCategoryName - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - ---- Returns coalition of the Object. --- @param Object#OBJECT self --- @return DCSCoalitionObject#coalition.side The side of the coalition. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetCoalition() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCoalition = DCSObject:getCoalition() - self:T3( ObjectCoalition ) - return ObjectCoalition - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - ---- Returns country of the Object. --- @param Object#OBJECT self --- @return DCScountry#country.id The country identifier. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetCountry() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCountry = DCSObject:getCountry() - self:T3( ObjectCountry ) - return ObjectCountry - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - - - ---- Returns Object descriptor. Descriptor type depends on Object category. --- @param Object#OBJECT self --- @return DCSObject#Object.Desc The Object descriptor. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetDesc() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectDesc = DCSObject:getDesc() - self:T2( ObjectDesc ) - return ObjectDesc - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) return nil end - - - - - - diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua index 7f30d885d..e474c94e6 100644 --- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua +++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20160626_0740' ) +env.info( 'Moose Generation Timestamp: 20160628_1157' ) local base = _G Include = {} @@ -3178,165 +3178,24 @@ function OBJECT:New( ObjectName ) end ---- Returns if the Object is alive. +--- Returns the unit's unique identifier. -- @param Object#OBJECT self --- @return #boolean true if Object is alive. +-- @return DCSObject#Object.ID ObjectID -- @return #nil The DCS Object is not existing or alive. -function OBJECT:IsAlive() +function OBJECT:GetID() self:F2( self.ObjectName ) local DCSObject = self:GetDCSObject() if DCSObject then - local ObjectIsAlive = DCSObject:isExist() - return ObjectIsAlive + local ObjectID = DCSObject:getID() + return ObjectID end - - return false -end - - - ---- Returns DCS Object object name. --- The function provides access to non-activated objects too. --- @param Object#OBJECT self --- @return #string The name of the DCS Object. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetName() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectName = self.ObjectName - return ObjectName - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) return nil end ---- Returns the type name of the DCS Object. --- @param Object#OBJECT self --- @return #string The type name of the DCS Object. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetTypeName() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectTypeName = DCSObject:getTypeName() - self:T3( ObjectTypeName ) - return ObjectTypeName - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - ---- Returns the Object's callsign - the localized string. --- @param Object#OBJECT self --- @return #string The Callsign of the Object. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetCallSign() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCallSign = DCSObject:getCallsign() - return ObjectCallSign - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - - ---- Returns the DCS Object category name as defined within the DCS Object Descriptor. --- @param Object#OBJECT self --- @return #string The DCS Object Category Name -function OBJECT:GetCategoryName() - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCategoryName = _CategoryName[ self:GetDesc().category ] - return ObjectCategoryName - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - ---- Returns coalition of the Object. --- @param Object#OBJECT self --- @return DCSCoalitionObject#coalition.side The side of the coalition. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetCoalition() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCoalition = DCSObject:getCoalition() - self:T3( ObjectCoalition ) - return ObjectCoalition - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - ---- Returns country of the Object. --- @param Object#OBJECT self --- @return DCScountry#country.id The country identifier. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetCountry() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCountry = DCSObject:getCountry() - self:T3( ObjectCountry ) - return ObjectCountry - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - - - ---- Returns Object descriptor. Descriptor type depends on Object category. --- @param Object#OBJECT self --- @return DCSObject#Object.Desc The Object descriptor. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetDesc() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectDesc = DCSObject:getDesc() - self:T2( ObjectDesc ) - return ObjectDesc - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - - - - - - - - --- This module contains the IDENTIFIABLE class. -- @@ -3393,7 +3252,7 @@ local _CategoryName = { -- @param DCSIdentifiable#Identifiable IdentifiableName The DCS Identifiable name -- @return #IDENTIFIABLE self function IDENTIFIABLE:New( IdentifiableName ) - local self = BASE:Inherit( self, BASE:New() ) + local self = BASE:Inherit( self, OBJECT:New( IdentifiableName ) ) self:F2( IdentifiableName ) self.IdentifiableName = IdentifiableName return self @@ -3459,6 +3318,21 @@ function IDENTIFIABLE:GetTypeName() end +--- Returns category of the DCS Identifiable. +-- @param #IDENTIFIABLE self +-- @return DCSObject#Object.Category The category ID +function IDENTIFIABLE:GetCategory() + self:F2( self.ObjectName ) + + local DCSObject = self:GetDCSObject() + if DCSObject then + local ObjectCategory = DCSObject:getCategory() + self:T3( ObjectCategory ) + return ObjectCategory + end + + return nil +end --- Returns the DCS Identifiable category name as defined within the DCS Identifiable Descriptor. @@ -9697,7 +9571,7 @@ function AIRBASE:FindByName( AirbaseName ) return AirbaseFound end -function AIRBASE:GetDCSAirbase() +function AIRBASE:GetDCSObject() local DCSAirbase = Airbase.getByName( self.AirbaseName ) if DCSAirbase then @@ -9707,203 +9581,6 @@ function AIRBASE:GetDCSAirbase() return nil end ---- Returns coalition of the Airbase. --- @param Airbase#AIRBASE self --- @return DCSCoalitionObject#coalition.side The side of the coalition. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetCoalition() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCoalition = DCSAirbase:getCoalition() - self:T3( AirbaseCoalition ) - return AirbaseCoalition - end - - return nil -end - ---- Returns country of the Airbase. --- @param Airbase#AIRBASE self --- @return DCScountry#country.id The country identifier. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetCountry() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCountry = DCSAirbase:getCountry() - self:T3( AirbaseCountry ) - return AirbaseCountry - end - - return nil -end - - ---- Returns DCS Airbase object name. --- The function provides access to non-activated units too. --- @param Airbase#AIRBASE self --- @return #string The name of the DCS Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetName() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseName = self.AirbaseName - return AirbaseName - end - - return nil -end - - ---- Returns if the airbase is alive. --- @param Airbase#AIRBASE self --- @return #boolean true if Airbase is alive. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:IsAlive() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseIsAlive = DCSAirbase:isExist() - return AirbaseIsAlive - end - - return false -end - ---- Returns the unit's unique identifier. --- @param Airbase#AIRBASE self --- @return DCSAirbase#Airbase.ID Airbase ID --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetID() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseID = DCSAirbase:getID() - return AirbaseID - end - - return nil -end - ---- Returns the Airbase's callsign - the localized string. --- @param Airbase#AIRBASE self --- @return #string The Callsign of the Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetCallSign() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCallSign = DCSAirbase:getCallsign() - return AirbaseCallSign - end - - return nil -end - - - ---- Returns unit descriptor. Descriptor type depends on unit category. --- @param Airbase#AIRBASE self --- @return DCSAirbase#Airbase.Desc The Airbase descriptor. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetDesc() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseDesc = DCSAirbase:getDesc() - return AirbaseDesc - end - - return nil -end - - ---- Returns the type name of the DCS Airbase. --- @param Airbase#AIRBASE self --- @return #string The type name of the DCS Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetTypeName() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseTypeName = DCSAirbase:getTypeName() - self:T3( AirbaseTypeName ) - return AirbaseTypeName - end - - return nil -end - - ---- Returns the @{DCSTypes#Vec2} vector indicating the point in 2D of the DCS Airbase within the mission. --- @param Airbase#AIRBASE self --- @return DCSTypes#Vec2 The 2D point vector of the DCS Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetPointVec2() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbasePointVec3 = DCSAirbase:getPosition().p - - local AirbasePointVec2 = {} - AirbasePointVec2.x = AirbasePointVec3.x - AirbasePointVec2.y = AirbasePointVec3.z - - self:T3( AirbasePointVec2 ) - return AirbasePointVec2 - end - - return nil -end - ---- Returns the DCS Airbase category as defined within the DCS Airbase Descriptor. --- @param Airbase#AIRBASE self --- @return DCSAirbase#Airbase.Category The DCS Airbase Category -function AIRBASE:GetCategory() - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCategory = self:GetDesc().category - return AirbaseCategory - end - - return nil -end - - ---- Returns the DCS Airbase category name as defined within the DCS Airbase Descriptor. --- @param Airbase#AIRBASE self --- @return #string The DCS Airbase Category Name -function AIRBASE:GetCategoryName() - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCategoryName = self.CategoryName[ self:GetDesc().category ] - return AirbaseCategoryName - end - - return nil -end --- This module contains the DATABASE class, managing the database of mission objects. diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 7f30d885d..e474c94e6 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20160626_0740' ) +env.info( 'Moose Generation Timestamp: 20160628_1157' ) local base = _G Include = {} @@ -3178,165 +3178,24 @@ function OBJECT:New( ObjectName ) end ---- Returns if the Object is alive. +--- Returns the unit's unique identifier. -- @param Object#OBJECT self --- @return #boolean true if Object is alive. +-- @return DCSObject#Object.ID ObjectID -- @return #nil The DCS Object is not existing or alive. -function OBJECT:IsAlive() +function OBJECT:GetID() self:F2( self.ObjectName ) local DCSObject = self:GetDCSObject() if DCSObject then - local ObjectIsAlive = DCSObject:isExist() - return ObjectIsAlive + local ObjectID = DCSObject:getID() + return ObjectID end - - return false -end - - - ---- Returns DCS Object object name. --- The function provides access to non-activated objects too. --- @param Object#OBJECT self --- @return #string The name of the DCS Object. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetName() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectName = self.ObjectName - return ObjectName - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) return nil end ---- Returns the type name of the DCS Object. --- @param Object#OBJECT self --- @return #string The type name of the DCS Object. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetTypeName() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectTypeName = DCSObject:getTypeName() - self:T3( ObjectTypeName ) - return ObjectTypeName - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - ---- Returns the Object's callsign - the localized string. --- @param Object#OBJECT self --- @return #string The Callsign of the Object. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetCallSign() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCallSign = DCSObject:getCallsign() - return ObjectCallSign - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - - ---- Returns the DCS Object category name as defined within the DCS Object Descriptor. --- @param Object#OBJECT self --- @return #string The DCS Object Category Name -function OBJECT:GetCategoryName() - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCategoryName = _CategoryName[ self:GetDesc().category ] - return ObjectCategoryName - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - ---- Returns coalition of the Object. --- @param Object#OBJECT self --- @return DCSCoalitionObject#coalition.side The side of the coalition. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetCoalition() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCoalition = DCSObject:getCoalition() - self:T3( ObjectCoalition ) - return ObjectCoalition - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - ---- Returns country of the Object. --- @param Object#OBJECT self --- @return DCScountry#country.id The country identifier. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetCountry() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectCountry = DCSObject:getCountry() - self:T3( ObjectCountry ) - return ObjectCountry - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - - - ---- Returns Object descriptor. Descriptor type depends on Object category. --- @param Object#OBJECT self --- @return DCSObject#Object.Desc The Object descriptor. --- @return #nil The DCS Object is not existing or alive. -function OBJECT:GetDesc() - self:F2( self.ObjectName ) - - local DCSObject = self:GetDCSObject() - - if DCSObject then - local ObjectDesc = DCSObject:getDesc() - self:T2( ObjectDesc ) - return ObjectDesc - end - - self:E( self.ClassName .. " " .. self.ObjectName .. " not found!" ) - return nil -end - - - - - - - - --- This module contains the IDENTIFIABLE class. -- @@ -3393,7 +3252,7 @@ local _CategoryName = { -- @param DCSIdentifiable#Identifiable IdentifiableName The DCS Identifiable name -- @return #IDENTIFIABLE self function IDENTIFIABLE:New( IdentifiableName ) - local self = BASE:Inherit( self, BASE:New() ) + local self = BASE:Inherit( self, OBJECT:New( IdentifiableName ) ) self:F2( IdentifiableName ) self.IdentifiableName = IdentifiableName return self @@ -3459,6 +3318,21 @@ function IDENTIFIABLE:GetTypeName() end +--- Returns category of the DCS Identifiable. +-- @param #IDENTIFIABLE self +-- @return DCSObject#Object.Category The category ID +function IDENTIFIABLE:GetCategory() + self:F2( self.ObjectName ) + + local DCSObject = self:GetDCSObject() + if DCSObject then + local ObjectCategory = DCSObject:getCategory() + self:T3( ObjectCategory ) + return ObjectCategory + end + + return nil +end --- Returns the DCS Identifiable category name as defined within the DCS Identifiable Descriptor. @@ -9697,7 +9571,7 @@ function AIRBASE:FindByName( AirbaseName ) return AirbaseFound end -function AIRBASE:GetDCSAirbase() +function AIRBASE:GetDCSObject() local DCSAirbase = Airbase.getByName( self.AirbaseName ) if DCSAirbase then @@ -9707,203 +9581,6 @@ function AIRBASE:GetDCSAirbase() return nil end ---- Returns coalition of the Airbase. --- @param Airbase#AIRBASE self --- @return DCSCoalitionObject#coalition.side The side of the coalition. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetCoalition() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCoalition = DCSAirbase:getCoalition() - self:T3( AirbaseCoalition ) - return AirbaseCoalition - end - - return nil -end - ---- Returns country of the Airbase. --- @param Airbase#AIRBASE self --- @return DCScountry#country.id The country identifier. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetCountry() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCountry = DCSAirbase:getCountry() - self:T3( AirbaseCountry ) - return AirbaseCountry - end - - return nil -end - - ---- Returns DCS Airbase object name. --- The function provides access to non-activated units too. --- @param Airbase#AIRBASE self --- @return #string The name of the DCS Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetName() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseName = self.AirbaseName - return AirbaseName - end - - return nil -end - - ---- Returns if the airbase is alive. --- @param Airbase#AIRBASE self --- @return #boolean true if Airbase is alive. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:IsAlive() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseIsAlive = DCSAirbase:isExist() - return AirbaseIsAlive - end - - return false -end - ---- Returns the unit's unique identifier. --- @param Airbase#AIRBASE self --- @return DCSAirbase#Airbase.ID Airbase ID --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetID() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseID = DCSAirbase:getID() - return AirbaseID - end - - return nil -end - ---- Returns the Airbase's callsign - the localized string. --- @param Airbase#AIRBASE self --- @return #string The Callsign of the Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetCallSign() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCallSign = DCSAirbase:getCallsign() - return AirbaseCallSign - end - - return nil -end - - - ---- Returns unit descriptor. Descriptor type depends on unit category. --- @param Airbase#AIRBASE self --- @return DCSAirbase#Airbase.Desc The Airbase descriptor. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetDesc() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseDesc = DCSAirbase:getDesc() - return AirbaseDesc - end - - return nil -end - - ---- Returns the type name of the DCS Airbase. --- @param Airbase#AIRBASE self --- @return #string The type name of the DCS Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetTypeName() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseTypeName = DCSAirbase:getTypeName() - self:T3( AirbaseTypeName ) - return AirbaseTypeName - end - - return nil -end - - ---- Returns the @{DCSTypes#Vec2} vector indicating the point in 2D of the DCS Airbase within the mission. --- @param Airbase#AIRBASE self --- @return DCSTypes#Vec2 The 2D point vector of the DCS Airbase. --- @return #nil The DCS Airbase is not existing or alive. -function AIRBASE:GetPointVec2() - self:F2( self.AirbaseName ) - - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbasePointVec3 = DCSAirbase:getPosition().p - - local AirbasePointVec2 = {} - AirbasePointVec2.x = AirbasePointVec3.x - AirbasePointVec2.y = AirbasePointVec3.z - - self:T3( AirbasePointVec2 ) - return AirbasePointVec2 - end - - return nil -end - ---- Returns the DCS Airbase category as defined within the DCS Airbase Descriptor. --- @param Airbase#AIRBASE self --- @return DCSAirbase#Airbase.Category The DCS Airbase Category -function AIRBASE:GetCategory() - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCategory = self:GetDesc().category - return AirbaseCategory - end - - return nil -end - - ---- Returns the DCS Airbase category name as defined within the DCS Airbase Descriptor. --- @param Airbase#AIRBASE self --- @return #string The DCS Airbase Category Name -function AIRBASE:GetCategoryName() - local DCSAirbase = self:GetDCSAirbase() - - if DCSAirbase then - local AirbaseCategoryName = self.CategoryName[ self:GetDesc().category ] - return AirbaseCategoryName - end - - return nil -end --- This module contains the DATABASE class, managing the database of mission objects. diff --git a/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz b/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz index f5743e2d5..495301a36 100644 Binary files a/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz and b/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz differ diff --git a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz b/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz index a40541339..2028748a3 100644 Binary files a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz and b/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz differ diff --git a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz index 8939a96e8..974231d04 100644 Binary files a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz and b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz differ diff --git a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz index 89ee9770c..281364691 100644 Binary files a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz and b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz differ diff --git a/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz b/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz index 190fd65f9..926d5a672 100644 Binary files a/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz and b/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz differ diff --git a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz index 7b0bb991e..e240a8c6f 100644 Binary files a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz and b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz differ diff --git a/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz b/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz index c9ae54b5f..f6747e891 100644 Binary files a/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz and b/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz differ diff --git a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz b/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz index d8636d2bd..0de31f18c 100644 Binary files a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz and b/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz differ diff --git a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz b/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz index 1d5a774d0..cc6aabb56 100644 Binary files a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz and b/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz differ diff --git a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz index 5f4ee1984..58e8da5fb 100644 Binary files a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz and b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz differ diff --git a/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz b/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz index 02ea77fa3..b43b091cf 100644 Binary files a/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz and b/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz differ diff --git a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz b/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz index d91ec66b1..488a834fc 100644 Binary files a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz and b/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz differ diff --git a/Moose Test Missions/Moose_Test_PATROLZONE/MOOSE_Test_PATROLZONE.miz b/Moose Test Missions/Moose_Test_PATROLZONE/MOOSE_Test_PATROLZONE.miz index db3b2171d..e8216710f 100644 Binary files a/Moose Test Missions/Moose_Test_PATROLZONE/MOOSE_Test_PATROLZONE.miz and b/Moose Test Missions/Moose_Test_PATROLZONE/MOOSE_Test_PATROLZONE.miz differ diff --git a/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz b/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz index 8942ee416..4a4ded915 100644 Binary files a/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz and b/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz differ diff --git a/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz b/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz index b18755943..2a060d33f 100644 Binary files a/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz and b/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz differ diff --git a/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz b/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz index 5bd652aeb..73c8c3836 100644 Binary files a/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz and b/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz differ diff --git a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz b/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz index 80907c6e5..312fd3a20 100644 Binary files a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz and b/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz differ diff --git a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz index e52fe5d86..b13f1b3e9 100644 Binary files a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz and b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz differ diff --git a/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz b/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz index be33534cb..b2d996e7a 100644 Binary files a/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz and b/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz differ diff --git a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz b/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz index ccb22ec8b..66b1ef251 100644 Binary files a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz and b/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz differ diff --git a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz index e2b82e9ab..1f58c02b7 100644 Binary files a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz and b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz b/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz index ac6114ce0..aee15d5ef 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz and b/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz b/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz index 8964c9fd2..a14b342a7 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz and b/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz b/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz index c81572b99..877249fe9 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz and b/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz b/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz index 17c016fea..50b0984b4 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz and b/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz differ