Merge pull request #57 from FlightControl-Master/Build-Sets

Build sets
This commit is contained in:
Sven Van de Velde 2016-05-27 13:42:34 +02:00
commit f3b8835a16
70 changed files with 3549 additions and 2695 deletions

View File

@ -487,7 +487,10 @@ function BASE:E( Arguments )
end
local LineCurrent = DebugInfoCurrent.currentline
local LineFrom = DebugInfoFrom.currentline
local LineFrom = -1
if DebugInfoFrom then
LineFrom = DebugInfoFrom.currentline
end
env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) )
end

View File

@ -1,64 +1,34 @@
--- Manage sets of units and groups.
--- Manage the mission database.
--
-- @{#Database} class
-- @{#DATABASE} class
-- ==================
-- Mission designers can use the DATABASE class to build sets of units belonging to certain:
-- Mission designers can use the DATABASE class to refer to:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
-- * UNITS
-- * GROUPS
-- * players
-- * alive players
-- * CLIENTS
-- * alive CLIENTS
--
-- This list will grow over time. Planned developments are to include filters and iterators.
-- Additional filters will be added around @{Zone#ZONEs}, Radiuses, Active players, ...
-- More iterators will be implemented in the near future ...
--
-- Administers the Initial Sets of the Mission Templates as defined within the Mission Editor.
--
-- DATABASE construction methods:
-- =================================
-- Create a new DATABASE object with the @{#DATABASE.New} method:
--
-- * @{#DATABASE.New}: Creates a new DATABASE object.
--
--
-- DATABASE filter criteria:
-- =========================
-- You can set filter criteria to define the set of units within the database.
-- Filter criteria are defined by:
--
-- * @{#DATABASE.FilterCoalitions}: Builds the DATABASE with the units belonging to the coalition(s).
-- * @{#DATABASE.FilterCategories}: Builds the DATABASE with the units belonging to the category(ies).
-- * @{#DATABASE.FilterTypes}: Builds the DATABASE with the units belonging to the unit type(s).
-- * @{#DATABASE.FilterCountries}: Builds the DATABASE with the units belonging to the country(ies).
-- * @{#DATABASE.FilterUnitPrefixes}: Builds the DATABASE with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the DATABASE, you can start filtering using:
--
-- * @{#DATABASE.FilterStart}: Starts the filtering of the units within the database.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#DATABASE.FilterGroupPrefixes}: Builds the DATABASE with the groups of the units starting with the same prefix string(s).
-- * @{#DATABASE.FilterZones}: Builds the DATABASE with the units within a @{Zone#ZONE}.
-- On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Gruop templates as defined within the Mission Editor.
--
-- Moose will automatically create one instance of the DATABASE class into the **global** object _DATABASE.
-- Moose refers to _DATABASE within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.
--
-- DATABASE iterators:
-- ===================
-- Once the filters have been defined and the DATABASE has been built, you can iterate the database with the available iterator methods.
-- You can iterate the database with the available iterator methods.
-- The iterator methods will walk the DATABASE set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the DATABASE:
--
-- * @{#DATABASE.ForEachAliveUnit}: Calls a function for each alive unit it finds within the DATABASE.
-- * @{#DATABASE.ForEachUnit}: Calls a function for each @{UNIT} it finds within the DATABASE.
-- * @{#DATABASE.ForEachGroup}: Calls a function for each @{GROUP} it finds within the DATABASE.
-- * @{#DATABASE.ForEachPlayer}: Calls a function for each player it finds within the DATABASE.
-- * @{#DATABASE.ForEachPlayerAlive}: Calls a function for each alive player it finds within the DATABASE.
-- * @{#DATABASE.ForEachClient}: Calls a function for each @{CLIENT} it finds within the DATABASE.
-- * @{#DATABASE.ForEachClientAlive}: Calls a function for each alive @{CLIENT} it finds within the DATABASE.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#DATABASE.ForEachUnit}: Calls a function for each unit contained within the DATABASE.
-- * @{#DATABASE.ForEachGroup}: Calls a function for each group contained within the DATABASE.
-- * @{#DATABASE.ForEachUnitInZone}: Calls a function for each unit within a certain zone contained within the DATABASE.
--
-- ====
-- @module Database
-- @author FlightControl
@ -70,6 +40,7 @@ Include.File( "Unit" )
Include.File( "Event" )
Include.File( "Client" )
--- DATABASE class
-- @type DATABASE
-- @extends Base#BASE
@ -85,34 +56,11 @@ DATABASE = {
DCSGroups = {},
UNITS = {},
GROUPS = {},
NavPoints = {},
Statics = {},
Players = {},
PlayersAlive = {},
PLAYERS = {},
PLAYERSALIVE = {},
CLIENTS = {},
ClientsAlive = {},
Filter = {
Coalitions = nil,
Categories = nil,
Types = nil,
Countries = nil,
UnitPrefixes = nil,
GroupPrefixes = nil,
},
FilterMeta = {
Coalitions = {
red = coalition.side.RED,
blue = coalition.side.BLUE,
neutral = coalition.side.NEUTRAL,
},
Categories = {
plane = Unit.Category.AIRPLANE,
helicopter = Unit.Category.HELICOPTER,
ground = Unit.Category.GROUND_UNIT,
ship = Unit.Category.SHIP,
structure = Unit.Category.STRUCTURE,
},
},
CLIENTSALIVE = {},
NavPoints = {},
}
local _DATABASECoalition =
@ -147,12 +95,13 @@ function DATABASE:New()
_EVENTDISPATCHER:OnCrash( self._EventOnDeadOrCrash, self )
-- Add database with registered clients and already alive players
-- Follow alive players and clients
_EVENTDISPATCHER:OnPlayerEnterUnit( self._EventOnPlayerEnterUnit, self )
_EVENTDISPATCHER:OnPlayerLeaveUnit( self._EventOnPlayerLeaveUnit, self )
self:_RegisterTemplates()
self:_RegisterDatabase()
self:_RegisterPlayers()
return self
end
@ -167,6 +116,7 @@ function DATABASE:FindUnit( UnitName )
return UnitFound
end
--- Adds a Unit based on the Unit Name in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddUnit( DCSUnit, DCSUnitName )
@ -175,6 +125,7 @@ function DATABASE:AddUnit( DCSUnit, DCSUnitName )
self.UNITS[DCSUnitName] = UNIT:Register( DCSUnitName )
end
--- Deletes a Unit from the DATABASE based on the Unit Name.
-- @param #DATABASE self
function DATABASE:DeleteUnit( DCSUnitName )
@ -182,6 +133,7 @@ function DATABASE:DeleteUnit( DCSUnitName )
self.DCSUnits[DCSUnitName] = nil
end
--- Finds a CLIENT based on the ClientName.
-- @param #DATABASE self
-- @param #string ClientName
@ -192,6 +144,7 @@ function DATABASE:FindClient( ClientName )
return ClientFound
end
--- Adds a CLIENT based on the ClientName in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddClient( ClientName )
@ -200,6 +153,7 @@ function DATABASE:AddClient( ClientName )
self:E( self.CLIENTS[ClientName]:GetClassNameAndID() )
end
--- Finds a GROUP based on the GroupName.
-- @param #DATABASE self
-- @param #string GroupName
@ -210,6 +164,7 @@ function DATABASE:FindGroup( GroupName )
return GroupFound
end
--- Adds a GROUP based on the GroupName in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddGroup( DCSGroup, GroupName )
@ -218,6 +173,30 @@ function DATABASE:AddGroup( DCSGroup, GroupName )
self.GROUPS[GroupName] = GROUP:Register( GroupName )
end
--- Adds a player based on the Player Name in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddPlayer( UnitName, PlayerName )
if PlayerName then
self:E( { "Add player for unit:", UnitName, PlayerName } )
self.PLAYERS[PlayerName] = PlayerName
self.PLAYERSALIVE[PlayerName] = PlayerName
self.CLIENTSALIVE[PlayerName] = self:FindClient( UnitName )
end
end
--- Deletes a player from the DATABASE based on the Player Name.
-- @param #DATABASE self
function DATABASE:DeletePlayer( PlayerName )
if PlayerName then
self:E( { "Clean player:", PlayerName } )
self.PLAYERSALIVE[PlayerName] = nil
self.CLIENTSALIVE[PlayerName] = nil
end
end
--- Instantiate new Groups within the DCSRTE.
-- This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined:
-- SpawnCountryID, SpawnCategoryID
@ -226,9 +205,9 @@ end
-- @param #table SpawnTemplate
-- @return #DATABASE self
function DATABASE:Spawn( SpawnTemplate )
self:F( SpawnTemplate.name )
self:F2( SpawnTemplate.name )
self:T( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
self:T2( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
-- Copy the spawn variables of the template in temporary storage, nullify, and restore the spawn variables.
local SpawnCoalitionID = SpawnTemplate.SpawnCoalitionID
@ -240,7 +219,7 @@ function DATABASE:Spawn( SpawnTemplate )
SpawnTemplate.SpawnCountryID = nil
SpawnTemplate.SpawnCategoryID = nil
self:_RegisterGroup( SpawnTemplate )
self:_RegisterTemplate( SpawnTemplate )
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
-- Restore
@ -253,18 +232,16 @@ function DATABASE:Spawn( SpawnTemplate )
return SpawnGroup
end
--- Set a status to a Group within the Database, this to check crossing events for example.
function DATABASE:SetStatusGroup( GroupName, Status )
self:F( Status )
self:F2( Status )
self.Templates.Groups[GroupName].Status = Status
end
--- Get a status to a Group within the Database, this to check crossing events for example.
function DATABASE:GetStatusGroup( GroupName )
self:F( Status )
self:F2( Status )
if self.Templates.Groups[GroupName] then
return self.Templates.Groups[GroupName].Status
@ -273,11 +250,12 @@ function DATABASE:GetStatusGroup( GroupName )
end
end
--- Private method that registers new Group Templates within the DATABASE Object.
-- @param #DATABASE self
-- @param #table GroupTemplate
-- @return #DATABASE self
function DATABASE:_RegisterGroup( GroupTemplate )
function DATABASE:_RegisterTemplate( GroupTemplate )
local GroupTemplateName = env.getValueDictByKey(GroupTemplate.name)
@ -297,7 +275,7 @@ function DATABASE:_RegisterGroup( GroupTemplate )
self.Templates.Groups[GroupTemplateName].UnitCount = #GroupTemplate.units
self.Templates.Groups[GroupTemplateName].Units = GroupTemplate.units
self:T( { "Group", self.Templates.Groups[GroupTemplateName].GroupName, self.Templates.Groups[GroupTemplateName].UnitCount } )
self:T2( { "Group", self.Templates.Groups[GroupTemplateName].GroupName, self.Templates.Groups[GroupTemplateName].UnitCount } )
for unit_num, UnitTemplate in pairs( GroupTemplate.units ) do
@ -317,6 +295,7 @@ function DATABASE:_RegisterGroup( GroupTemplate )
end
end
--- Private method that registers all alive players in the mission.
-- @param #DATABASE self
-- @return #DATABASE self
@ -328,9 +307,10 @@ function DATABASE:_RegisterPlayers()
self:T3( { "UnitData:", UnitData } )
if UnitData and UnitData:isExist() then
local UnitName = UnitData:getName()
if not self.PlayersAlive[UnitName] then
self:E( { "Add player for unit:", UnitName, UnitData:getPlayerName() } )
self.PlayersAlive[UnitName] = UnitData:getPlayerName()
local PlayerName = UnitData:getPlayerName()
if not self.PLAYERS[PlayerName] then
self:E( { "Add player for unit:", UnitName, PlayerName } )
self:AddPlayer( UnitName, PlayerName )
end
end
end
@ -339,6 +319,7 @@ function DATABASE:_RegisterPlayers()
return self
end
--- Private method that registers all datapoints within in the mission.
-- @param #DATABASE self
-- @return #DATABASE self
@ -381,22 +362,21 @@ end
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnBirth( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
self:AddUnit( Event.IniDCSUnit, Event.IniDCSUnitName )
self:AddGroup( Event.IniDCSGroup, Event.IniDCSGroupName )
self:_EventOnPlayerEnterUnit( Event )
end
self:AddUnit( Event.IniDCSUnit, Event.IniDCSUnitName )
self:AddGroup( Event.IniDCSGroup, Event.IniDCSGroupName )
self:_EventOnPlayerEnterUnit( Event )
end
end
--- Handles the OnDead or OnCrash event for alive units set.
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnDeadOrCrash( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self.DCSUnits[Event.IniDCSUnitName] then
@ -406,48 +386,44 @@ function DATABASE:_EventOnDeadOrCrash( Event )
end
end
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnPlayerEnterUnit( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
if not self.PlayersAlive[Event.IniDCSUnitName] then
self:E( { "Add player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
self.PlayersAlive[Event.IniDCSUnitName] = Event.IniDCSUnit:getPlayerName()
self.ClientsAlive[Event.IniDCSUnitName] = self.CLIENTS[ Event.IniDCSUnitName ]
end
local PlayerName = Event.IniDCSUnit:getPlayerName()
if not self.PLAYERSALIVE[PlayerName] then
self:AddPlayer( Event.IniDCSUnitName, PlayerName )
end
end
end
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnPlayerLeaveUnit( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
if self.PlayersAlive[Event.IniDCSUnitName] then
self:E( { "Cleaning player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
self.PlayersAlive[Event.IniDCSUnitName] = nil
self.ClientsAlive[Event.IniDCSUnitName] = nil
end
local PlayerName = Event.IniDCSUnit:getPlayerName()
if self.PLAYERSALIVE[PlayerName] then
self:DeletePlayer( PlayerName )
end
end
end
--- Iterators
--- Interate the DATABASE and call an interator function for the given set, providing the Object for each element within the set and optional parameters.
--- Iterate the DATABASE and call an iterator function for the given set, providing the Object for each element within the set and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database.
-- @return #DATABASE self
function DATABASE:ForEach( IteratorFunction, arg, Set )
self:F( arg )
self:F2( arg )
local function CoRoutine()
local Count = 0
@ -467,7 +443,7 @@ function DATABASE:ForEach( IteratorFunction, arg, Set )
local function Schedule()
local status, res = coroutine.resume( co )
self:T( { status, res } )
self:T2( { status, res } )
if status == false then
error( res )
@ -485,46 +461,96 @@ function DATABASE:ForEach( IteratorFunction, arg, Set )
end
--- Interate the DATABASE and call an interator function for each **alive** unit, providing the Unit and optional parameters.
--- Iterate the DATABASE and call an iterator function for each **alive** unit, providing the DCSUnit and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive unit in the database. The function needs to accept a UNIT parameter.
-- @param #function IteratorFunction The function that will be called when there is an alive unit in the database. The function needs to accept a DCSUnit parameter.
-- @return #DATABASE self
function DATABASE:ForEachDCSUnit( IteratorFunction, ... )
self:F( arg )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.DCSUnits )
return self
end
--- Interate the DATABASE and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
--- Iterate the DATABASE and call an iterator function for each **alive** UNIT, providing the UNIT and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a UNIT parameter.
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the database. The function needs to accept a UNIT parameter.
-- @return #DATABASE self
function DATABASE:ForEachUnit( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.UNITS )
return self
end
--- Iterate the DATABASE and call an iterator function for each **alive** GROUP, providing the GROUP and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the database. The function needs to accept a GROUP parameter.
-- @return #DATABASE self
function DATABASE:ForEachGroup( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.GROUPS )
return self
end
--- Iterate the DATABASE and call an iterator function for each player, providing the player name and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an player in the database. The function needs to accept the player name.
-- @return #DATABASE self
function DATABASE:ForEachPlayer( IteratorFunction, ... )
self:F( arg )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.PlayersAlive )
self:ForEach( IteratorFunction, arg, self.PLAYERS )
return self
end
--- Interate the DATABASE and call an interator function for each client, providing the Client to the function and optional parameters.
--- Iterate the DATABASE and call an iterator function for each **alive** player, providing the Unit of the player and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a UNIT parameter.
-- @return #DATABASE self
function DATABASE:ForEachPlayerAlive( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.PLAYERSALIVE )
return self
end
--- Iterate the DATABASE and call an iterator function for each CLIENT, providing the CLIENT to the function and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a CLIENT parameter.
-- @return #DATABASE self
function DATABASE:ForEachClient( IteratorFunction, ... )
self:F( arg )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.CLIENTS )
return self
end
--- Iterate the DATABASE and call an iterator function for each **ALIVE** CLIENT, providing the CLIENT to the function and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the database. The function needs to accept a CLIENT parameter.
-- @return #DATABASE self
function DATABASE:ForEachClientAlive( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.CLIENTSALIVE )
function DATABASE:ScanEnvironment()
self:F()
return self
end
function DATABASE:_RegisterTemplates()
self:F2()
self.Navpoints = {}
self.UNITS = {}
@ -574,7 +600,7 @@ function DATABASE:ScanEnvironment()
for group_num, GroupTemplate in pairs(obj_type_data.group) do
if GroupTemplate and GroupTemplate.units and type(GroupTemplate.units) == 'table' then --making sure again- this is a valid group
self:_RegisterGroup( GroupTemplate )
self:_RegisterTemplate( GroupTemplate )
end --if GroupTemplate and GroupTemplate.units then
end --for group_num, GroupTemplate in pairs(obj_type_data.group) do
end --if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
@ -586,120 +612,9 @@ function DATABASE:ScanEnvironment()
end --if coa_name == 'red' or coa_name == 'blue' and type(coa_data) == 'table' then
end --for coa_name, coa_data in pairs(mission.coalition) do
self:_RegisterDatabase()
self:_RegisterPlayers()
return self
end
---
-- @param #DATABASE self
-- @param DCSUnit#Unit DCSUnit
-- @return #DATABASE self
function DATABASE:_IsIncludeDCSUnit( DCSUnit )
self:F( DCSUnit )
local DCSUnitInclude = true
if self.Filter.Coalitions then
local DCSUnitCoalition = false
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
self:T( { "Coalition:", DCSUnit:getCoalition(), self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == DCSUnit:getCoalition() then
DCSUnitCoalition = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCoalition
end
if self.Filter.Categories then
local DCSUnitCategory = false
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
self:T( { "Category:", DCSUnit:getDesc().category, self.FilterMeta.Categories[CategoryName], CategoryName } )
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == DCSUnit:getDesc().category then
DCSUnitCategory = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCategory
end
if self.Filter.Types then
local DCSUnitType = false
for TypeID, TypeName in pairs( self.Filter.Types ) do
self:T( { "Type:", DCSUnit:getTypeName(), TypeName } )
if TypeName == DCSUnit:getTypeName() then
DCSUnitType = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitType
end
if self.Filter.Countries then
local DCSUnitCountry = false
for CountryID, CountryName in pairs( self.Filter.Countries ) do
self:T( { "Country:", DCSUnit:getCountry(), CountryName } )
if country.id[CountryName] == DCSUnit:getCountry() then
DCSUnitCountry = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCountry
end
if self.Filter.UnitPrefixes then
local DCSUnitPrefix = false
for UnitPrefixId, UnitPrefix in pairs( self.Filter.UnitPrefixes ) do
self:T( { "Unit Prefix:", string.find( DCSUnit:getName(), UnitPrefix, 1 ), UnitPrefix } )
if string.find( DCSUnit:getName(), UnitPrefix, 1 ) then
DCSUnitPrefix = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitPrefix
end
self:T( DCSUnitInclude )
return DCSUnitInclude
end
---
-- @param #DATABASE self
-- @param DCSUnit#Unit DCSUnit
-- @return #DATABASE self
function DATABASE:_IsAliveDCSUnit( DCSUnit )
self:F( DCSUnit )
local DCSUnitAlive = false
if DCSUnit and DCSUnit:isExist() and DCSUnit:isActive() then
if self.DCSUnits[DCSUnit:getName()] then
DCSUnitAlive = true
end
end
self:T( DCSUnitAlive )
return DCSUnitAlive
end
---
-- @param #DATABASE self
-- @param DCSGroup#Group DCSGroup
-- @return #DATABASE self
function DATABASE:_IsAliveDCSGroup( DCSGroup )
self:F( DCSGroup )
local DCSGroupAlive = false
if DCSGroup and DCSGroup:isExist() then
if self.DCSGroups[DCSGroup:getName()] then
DCSGroupAlive = true
end
end
self:T( DCSGroupAlive )
return DCSGroupAlive
end
--- Traces the current database contents in the log ... (for debug reasons).
-- @param #DATABASE self
-- @return #DATABASE self
function DATABASE:TraceDatabase()
self:F()
self:T( { "DCSUnits:", self.DCSUnits } )
end

View File

@ -64,7 +64,7 @@ local _EVENTCODES = {
function EVENT:New()
local self = BASE:Inherit( self, BASE:New() )
self:F()
self:F2()
self.EventHandler = world.addEventHandler( self )
return self
end
@ -154,7 +154,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnBirthForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnBirthForUnit )
@ -167,7 +167,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnBirth( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_BIRTH )
@ -181,7 +181,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnBirthForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_BIRTH )
@ -195,7 +195,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnCrashForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnCrashForUnit )
@ -208,7 +208,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnCrash( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_CRASH )
@ -222,7 +222,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnCrashForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_CRASH )
@ -236,7 +236,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnDeadForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnDeadForUnit )
@ -249,7 +249,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnDead( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_DEAD )
@ -264,7 +264,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnDeadForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_DEAD )
@ -278,7 +278,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnPilotDeadForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_PILOT_DEAD )
@ -292,7 +292,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnLandForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnLandForUnit )
@ -306,7 +306,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnLandForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_LAND )
@ -320,7 +320,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnTakeOffForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnTakeOffForUnit )
@ -334,7 +334,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnTakeOffForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_TAKEOFF )
@ -348,7 +348,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnEngineShutDownForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnEngineShutDownForUnit )
@ -362,7 +362,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnEngineShutDownForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_ENGINE_SHUTDOWN )
@ -376,7 +376,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnEngineStartUpForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_ENGINE_STARTUP )
@ -389,7 +389,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnShot( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_SHOT )
@ -403,7 +403,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnShotForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_SHOT )
@ -416,7 +416,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnHit( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_HIT )
@ -430,7 +430,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnHitForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_HIT )
@ -443,7 +443,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnPlayerEnterUnit( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_PLAYER_ENTER_UNIT )
@ -456,7 +456,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnPlayerLeaveUnit( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_PLAYER_LEAVE_UNIT )
@ -466,7 +466,7 @@ end
function EVENT:onEvent( Event )
self:F( { _EVENTCODES[Event.id], Event } )
self:F2( { _EVENTCODES[Event.id], Event } )
if self and self.Events and self.Events[Event.id] then
if Event.initiator and Event.initiator:getCategory() == Object.Category.UNIT then

View File

@ -198,6 +198,23 @@ function GROUP:GetCoalition()
return nil
end
--- Returns the country of the DCS Group.
-- @param #GROUP self
-- @return DCScountry#country.id The country identifier.
-- @return #nil The DCS Group is not existing or alive.
function GROUP:GetCountry()
self:F2( self.GroupName )
local DCSGroup = self:GetDCSGroup()
if DCSGroup then
local GroupCountry = DCSGroup:getUnit(1):getCountry()
self:T3( GroupCountry )
return GroupCountry
end
return nil
end
--- Returns the name of the DCS Group.
-- @param #GROUP self
-- @return #string The DCS Group name.

View File

@ -0,0 +1,327 @@
--- Create and manage a set of groups.
--
-- @{#GROUPSET} class
-- ==================
-- Mission designers can use the GROUPSET class to build sets of groups belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Starting with certain prefix strings.
--
-- GROUPSET construction methods:
-- =================================
-- Create a new GROUPSET object with the @{#GROUPSET.New} method:
--
-- * @{#GROUPSET.New}: Creates a new GROUPSET object.
--
--
-- GROUPSET filter criteria:
-- =========================
-- You can set filter criteria to define the set of groups within the GROUPSET.
-- Filter criteria are defined by:
--
-- * @{#GROUPSET.FilterCoalitions}: Builds the GROUPSET with the groups belonging to the coalition(s).
-- * @{#GROUPSET.FilterCategories}: Builds the GROUPSET with the groups belonging to the category(ies).
-- * @{#GROUPSET.FilterTypes}: Builds the GROUPSET with the groups belonging to the unit type(s).
-- * @{#GROUPSET.FilterPrefixes}: Builds the GROUPSET with the groups starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the GROUPSET, you can start filtering using:
--
-- * @{#GROUPSET.FilterStart}: Starts the filtering of the groups within the GROUPSET.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#GROUPSET.FilterZones}: Builds the GROUPSET with the groups within a @{Zone#ZONE}.
--
--
-- GROUPSET iterators:
-- ===================
-- Once the filters have been defined and the GROUPSET has been built, you can iterate the GROUPSET with the available iterator methods.
-- The iterator methods will walk the GROUPSET set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the GROUPSET:
--
-- * @{#GROUPSET.ForEachGroup}: Calls a function for each alive unit it finds within the GROUPSET.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#GROUPSET.ForEachUnitInGroup}: Calls a function for each group contained within the GROUPSET.
-- * @{#GROUPSET.ForEachUnitInZone}: Calls a function for each unit within a certain zone contained within the GROUPSET.
--
-- @module GroupSet
-- @author FlightControl
Include.File( "Routines" )
Include.File( "Base" )
Include.File( "Group" )
Include.File( "Set" )
--- GROUPSET class
-- @type GROUPSET
-- @extends Set#SET
GROUPSET = {
ClassName = "GROUPSET",
Units = {},
Filter = {
Coalitions = nil,
Categories = nil,
Countries = nil,
GroupPrefixes = nil,
},
FilterMeta = {
Coalitions = {
red = coalition.side.RED,
blue = coalition.side.BLUE,
neutral = coalition.side.NEUTRAL,
},
Categories = {
plane = Group.Category.AIRPLANE,
helicopter = Group.Category.HELICOPTER,
ground = Group.Category.GROUND_UNIT,
ship = Group.Category.SHIP,
structure = Group.Category.STRUCTURE,
},
},
}
--- Creates a new GROUPSET object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.
-- @param #GROUPSET self
-- @return #GROUPSET
-- @usage
-- -- Define a new GROUPSET Object. This DBObject will contain a reference to all alive GROUPS.
-- DBObject = GROUPSET:New()
function GROUPSET:New()
-- Inherits from BASE
local self = BASE:Inherit( self, SET:New( _DATABASE.GROUPS ) )
return self
end
--- Finds a Unit based on the Unit Name.
-- @param #GROUPSET self
-- @param #string GroupName
-- @return Group#GROUP The found Unit.
function GROUPSET:FindUnit( GroupName )
local GroupFound = self.Set[GroupName]
return GroupFound
end
--- Builds a set of groups of coalitions.
-- Possible current coalitions are red, blue and neutral.
-- @param #GROUPSET self
-- @param #string Coalitions Can take the following values: "red", "blue", "neutral".
-- @return #GROUPSET self
function GROUPSET:FilterCoalitions( Coalitions )
if not self.Filter.Coalitions then
self.Filter.Coalitions = {}
end
if type( Coalitions ) ~= "table" then
Coalitions = { Coalitions }
end
for CoalitionID, Coalition in pairs( Coalitions ) do
self.Filter.Coalitions[Coalition] = Coalition
end
return self
end
--- Builds a set of groups out of categories.
-- Possible current categories are plane, helicopter, ground, ship.
-- @param #GROUPSET self
-- @param #string Categories Can take the following values: "plane", "helicopter", "ground", "ship".
-- @return #GROUPSET self
function GROUPSET:FilterCategories( Categories )
if not self.Filter.Categories then
self.Filter.Categories = {}
end
if type( Categories ) ~= "table" then
Categories = { Categories }
end
for CategoryID, Category in pairs( Categories ) do
self.Filter.Categories[Category] = Category
end
return self
end
--- Builds a set of groups of defined countries.
-- Possible current countries are those known within DCS world.
-- @param #GROUPSET self
-- @param #string Countries Can take those country strings known within DCS world.
-- @return #GROUPSET self
function GROUPSET:FilterCountries( Countries )
if not self.Filter.Countries then
self.Filter.Countries = {}
end
if type( Countries ) ~= "table" then
Countries = { Countries }
end
for CountryID, Country in pairs( Countries ) do
self.Filter.Countries[Country] = Country
end
return self
end
--- Builds a set of groups of defined unit prefixes.
-- All the groups starting with the given prefixes will be included within the set.
-- @param #GROUPSET self
-- @param #string Prefixes The prefix of which the group name starts with.
-- @return #GROUPSET self
function GROUPSET:FilterPrefixes( Prefixes )
if not self.Filter.GroupPrefixes then
self.Filter.GroupPrefixes = {}
end
if type( Prefixes ) ~= "table" then
Prefixes = { Prefixes }
end
for PrefixID, Prefix in pairs( Prefixes ) do
self.Filter.GroupPrefixes[Prefix] = Prefix
end
return self
end
--- Starts the filtering.
-- @param #GROUPSET self
-- @return #GROUPSET self
function GROUPSET:FilterStart()
if _DATABASE then
self:_FilterStart()
end
return self
end
--- Handles the Database to check on an event (birth) that the Object was added in the Database.
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET birth event!
-- @param #GROUPSET self
-- @param Event#EVENTDATA Event
-- @return #string The name of the GROUP
-- @return #table The GROUP
function GROUPSET:AddInDatabase( Event )
self:F3( { Event } )
if not self.Database[Event.IniDCSGroupName] then
self.Database[Event.IniDCSGroupName] = GROUP:Register( Event.IniDCSGroupName )
self:T3( self.Database[Event.IniDCSGroupName] )
end
return Event.IniDCSGroupName, self.Database[Event.IniDCSGroupName]
end
--- Handles the Database to check on any event that Object exists in the Database.
-- This is required, because sometimes the _DATABASE event gets called later than the SET event or vise versa!
-- @param #GROUPSET self
-- @param Event#EVENTDATA Event
-- @return #string The name of the GROUP
-- @return #table The GROUP
function GROUPSET:FindInDatabase( Event )
self:F3( { Event } )
return Event.IniDCSGroupName, self.Database[Event.IniDCSGroupName]
end
--- Interate the GROUPSET and call an interator function for each **alive** GROUP, providing the GROUP and optional parameters.
-- @param #GROUPSET self
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the GROUPSET. The function needs to accept a GROUP parameter.
-- @return #GROUPSET self
function GROUPSET:ForEachUnit( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.Set )
return self
end
----- Interate the GROUPSET and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
---- @param #GROUPSET self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the GROUPSET. The function needs to accept a GROUP parameter.
---- @return #GROUPSET self
--function GROUPSET:ForEachPlayer( IteratorFunction, ... )
-- self:F2( arg )
--
-- self:ForEach( IteratorFunction, arg, self.PlayersAlive )
--
-- return self
--end
--
--
----- Interate the GROUPSET and call an interator function for each client, providing the Client to the function and optional parameters.
---- @param #GROUPSET self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the GROUPSET. The function needs to accept a CLIENT parameter.
---- @return #GROUPSET self
--function GROUPSET:ForEachClient( IteratorFunction, ... )
-- self:F2( arg )
--
-- self:ForEach( IteratorFunction, arg, self.Clients )
--
-- return self
--end
---
-- @param #GROUPSET self
-- @param Group#GROUP MooseGroup
-- @return #GROUPSET self
function GROUPSET:IsIncludeObject( MooseGroup )
self:F2( MooseGroup )
local MooseGroupInclude = true
if self.Filter.Coalitions then
local MooseGroupCoalition = false
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
self:T3( { "Coalition:", MooseGroup:GetCoalition(), self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == MooseGroup:GetCoalition() then
MooseGroupCoalition = true
end
end
MooseGroupInclude = MooseGroupInclude and MooseGroupCoalition
end
if self.Filter.Categories then
local MooseGroupCategory = false
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
self:T3( { "Category:", MooseGroup:GetCategory(), self.FilterMeta.Categories[CategoryName], CategoryName } )
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == MooseGroup:GetCategory() then
MooseGroupCategory = true
end
end
MooseGroupInclude = MooseGroupInclude and MooseGroupCategory
end
if self.Filter.Countries then
local MooseGroupCountry = false
for CountryID, CountryName in pairs( self.Filter.Countries ) do
self:T3( { "Country:", MooseGroup:GetCountry(), CountryName } )
if country.id[CountryName] == MooseGroup:GetCountry() then
MooseGroupCountry = true
end
end
MooseGroupInclude = MooseGroupInclude and MooseGroupCountry
end
if self.Filter.GroupPrefixes then
local MooseGroupPrefix = false
for GroupPrefixId, GroupPrefix in pairs( self.Filter.GroupPrefixes ) do
self:T3( { "Prefix:", string.find( MooseGroup:GetName(), GroupPrefix, 1 ), GroupPrefix } )
if string.find( MooseGroup:GetName(), GroupPrefix, 1 ) then
MooseGroupPrefix = true
end
end
MooseGroupInclude = MooseGroupInclude and MooseGroupPrefix
end
self:T2( MooseGroupInclude )
return MooseGroupInclude
end

View File

@ -11,5 +11,5 @@ Include.File( "Event" )
_EVENTDISPATCHER = EVENT:New() -- #EVENT
--- Declare the main database object, which is used internally by the MOOSE classes.
_DATABASE = DATABASE:New():ScanEnvironment() -- Database#DATABASE
_DATABASE = DATABASE:New() -- Database#DATABASE

View File

@ -75,371 +75,109 @@ Include.File( "Client" )
-- @extends Base#BASE
SET = {
ClassName = "SET",
Templates = {
Units = {},
Groups = {},
ClientsByName = {},
ClientsByID = {},
},
DCSUnits = {},
DCSUnitsAlive = {},
DCSGroups = {},
DCSGroupsAlive = {},
Units = {},
UnitsAlive = {},
Groups = {},
GroupsAlive = {},
NavPoints = {},
Statics = {},
Players = {},
PlayersAlive = {},
Clients = {},
ClientsAlive = {},
Filter = {
Coalitions = nil,
Categories = nil,
Types = nil,
Countries = nil,
UnitPrefixes = nil,
GroupPrefixes = nil,
},
FilterMeta = {
Coalitions = {
red = coalition.side.RED,
blue = coalition.side.BLUE,
neutral = coalition.side.NEUTRAL,
},
Categories = {
plane = Unit.Category.AIRPLANE,
helicopter = Unit.Category.HELICOPTER,
ground = Unit.Category.GROUND_UNIT,
ship = Unit.Category.SHIP,
structure = Unit.Category.STRUCTURE,
},
},
Set = {},
Database = {},
}
local _DATABASECoalition =
{
[1] = "Red",
[2] = "Blue",
}
local _DATABASECategory =
{
[Unit.Category.AIRPLANE] = "Plane",
[Unit.Category.HELICOPTER] = "Helicopter",
[Unit.Category.GROUND_UNIT] = "Vehicle",
[Unit.Category.SHIP] = "Ship",
[Unit.Category.STRUCTURE] = "Structure",
}
--- Creates a new SET object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.
-- @param #SET self
-- @return #SET
-- @usage
-- -- Define a new SET Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE.
-- DBObject = SET:New()
function SET:New()
function SET:New( Database )
-- Inherits from BASE
local self = BASE:Inherit( self, BASE:New() )
self.Database = Database
return self
end
--- Finds an Object based on the Object Name.
-- @param #SET self
-- @param #string ObjectName
-- @return #table The Object found.
function SET:_Find( ObjectName )
local ObjectFound = self.Set[ObjectName]
return ObjectFound
end
--- Adds a Object based on the Object Name.
-- @param #SET self
-- @param #string ObjectName
-- @param #table Object
-- @return #table The added Object.
function SET:_Add( ObjectName, Object )
self.Set[ObjectName] = Object
end
--- Starts the filtering for the defined collection.
-- @param #SET self
-- @return #SET self
function SET:_FilterStart()
for ObjectName, Object in pairs( self.Database ) do
if self:IsIncludeObject( Object ) then
self:E( { "Adding Object:", ObjectName } )
self:_Add( ObjectName, Object )
end
end
_EVENTDISPATCHER:OnBirth( self._EventOnBirth, self )
_EVENTDISPATCHER:OnDead( self._EventOnDeadOrCrash, self )
_EVENTDISPATCHER:OnCrash( self._EventOnDeadOrCrash, self )
-- Add SET with registered clients and already alive players
-- Follow alive players and clients
_EVENTDISPATCHER:OnPlayerEnterUnit( self._EventOnPlayerEnterUnit, self )
_EVENTDISPATCHER:OnPlayerLeaveUnit( self._EventOnPlayerLeaveUnit, self )
-- _EVENTDISPATCHER:OnPlayerEnterUnit( self._EventOnPlayerEnterUnit, self )
-- _EVENTDISPATCHER:OnPlayerLeaveUnit( self._EventOnPlayerLeaveUnit, self )
return self
end
--- Finds a Unit based on the Unit Name.
-- @param #SET self
-- @param #string UnitName
-- @return Unit#UNIT The found Unit.
function SET:FindUnit( UnitName )
local UnitFound = self.Units[UnitName]
return UnitFound
end
--- Finds a Unit based on the Unit Name.
-- @param #SET self
-- @param Unit#UNIT UnitToAdd
-- @return Unit#UNIT The added Unit.
function SET:AddUnit( UnitToAdd )
self.Units[UnitToAdd.UnitName] = UnitToAdd
return self.Units[UnitToAdd.UnitName]
end
--- Builds a set of units of coalitons.
-- Possible current coalitions are red, blue and neutral.
-- @param #SET self
-- @param #string Coalitions Can take the following values: "red", "blue", "neutral".
-- @return #SET self
function SET:FilterCoalitions( Coalitions )
if not self.Filter.Coalitions then
self.Filter.Coalitions = {}
end
if type( Coalitions ) ~= "table" then
Coalitions = { Coalitions }
end
for CoalitionID, Coalition in pairs( Coalitions ) do
self.Filter.Coalitions[Coalition] = Coalition
end
return self
end
--- Builds a set of units out of categories.
-- Possible current categories are plane, helicopter, ground, ship.
-- @param #SET self
-- @param #string Categories Can take the following values: "plane", "helicopter", "ground", "ship".
-- @return #SET self
function SET:FilterCategories( Categories )
if not self.Filter.Categories then
self.Filter.Categories = {}
end
if type( Categories ) ~= "table" then
Categories = { Categories }
end
for CategoryID, Category in pairs( Categories ) do
self.Filter.Categories[Category] = Category
end
return self
end
--- Builds a set of units of defined unit types.
-- Possible current types are those types known within DCS world.
-- @param #SET self
-- @param #string Types Can take those type strings known within DCS world.
-- @return #SET self
function SET:FilterTypes( Types )
if not self.Filter.Types then
self.Filter.Types = {}
end
if type( Types ) ~= "table" then
Types = { Types }
end
for TypeID, Type in pairs( Types ) do
self.Filter.Types[Type] = Type
end
return self
end
--- Builds a set of units of defined countries.
-- Possible current countries are those known within DCS world.
-- @param #SET self
-- @param #string Countries Can take those country strings known within DCS world.
-- @return #SET self
function SET:FilterCountries( Countries )
if not self.Filter.Countries then
self.Filter.Countries = {}
end
if type( Countries ) ~= "table" then
Countries = { Countries }
end
for CountryID, Country in pairs( Countries ) do
self.Filter.Countries[Country] = Country
end
return self
end
--- Builds a set of units of defined unit prefixes.
-- All the units starting with the given prefixes will be included within the set.
-- @param #SET self
-- @param #string Prefixes The prefix of which the unit name starts with.
-- @return #SET self
function SET:FilterUnitPrefixes( Prefixes )
if not self.Filter.UnitPrefixes then
self.Filter.UnitPrefixes = {}
end
if type( Prefixes ) ~= "table" then
Prefixes = { Prefixes }
end
for PrefixID, Prefix in pairs( Prefixes ) do
self.Filter.UnitPrefixes[Prefix] = Prefix
end
return self
end
--- Builds a set of units of defined group prefixes.
-- All the units starting with the given group prefixes will be included within the set.
-- @param #SET self
-- @param #string Prefixes The prefix of which the group name where the unit belongs to starts with.
-- @return #SET self
function SET:FilterGroupPrefixes( Prefixes )
if not self.Filter.GroupPrefixes then
self.Filter.GroupPrefixes = {}
end
if type( Prefixes ) ~= "table" then
Prefixes = { Prefixes }
end
for PrefixID, Prefix in pairs( Prefixes ) do
self.Filter.GroupPrefixes[Prefix] = Prefix
end
return self
end
--- Starts the filtering.
-- @param #SET self
-- @return #SET self
function SET:FilterStart()
if _DATABASE then
-- OK, we have a _DATABASE
-- Now use the different filters to build the set.
-- We first take ALL of the Units of the _DATABASE.
self:E( { "Adding Set Datapoints with filters" } )
for DCSUnitName, DCSUnit in pairs( _DATABASE.DCSUnits ) do
if self:_IsIncludeDCSUnit( DCSUnit ) then
self:E( { "Adding Unit:", DCSUnitName } )
self.DCSUnits[DCSUnitName] = _DATABASE.DCSUnits[DCSUnitName]
self.Units[DCSUnitName] = _DATABASE:FindUnit( DCSUnitName )
if _DATABASE.DCSUnitsAlive[DCSUnitName] then
self.DCSUnitsAlive[DCSUnitName] = _DATABASE.DCSUnitsAlive[DCSUnitName]
self.UnitsAlive[DCSUnitName] = _DATABASE.UnitsAlive[DCSUnitName]
end
end
end
for DCSGroupName, DCSGroup in pairs( _DATABASE.DCSGroups ) do
--if self:_IsIncludeDCSGroup( DCSGroup ) then
self:E( { "Adding Group:", DCSGroupName } )
self.DCSGroups[DCSGroupName] = _DATABASE.DCSGroups[DCSGroupName]
self.Groups[DCSGroupName] = _DATABASE:FindGroups( DCSGroupName )
--end
if _DATABASE.DCSGroupsAlive[DCSGroupName] then
self.DCSGroupsAlive[DCSGroupName] = _DATABASE.DCSGroupsAlive[DCSGroupName]
self.GroupsAlive[DCSGroupName] = _DATABASE.GroupsAlive[DCSGroupName]
end
end
for DCSUnitName, Client in pairs( _DATABASE.CLIENTS ) do
self:E( { "Adding Client for Unit:", DCSUnitName } )
self.Clients[DCSUnitName] = _DATABASE.Clients[DCSUnitName]
end
else
self:E( "There is a structural error in MOOSE. No _DATABASE has been defined! Cannot build this custom SET." )
end
return self
end
--- Private method that registers all alive players in the mission.
-- @param #SET self
-- @return #SET self
function SET:_RegisterPlayers()
local CoalitionsData = { AlivePlayersRed = coalition.getPlayers( coalition.side.RED ), AlivePlayersBlue = coalition.getPlayers( coalition.side.BLUE ) }
for CoalitionId, CoalitionData in pairs( CoalitionsData ) do
for UnitId, UnitData in pairs( CoalitionData ) do
self:T3( { "UnitData:", UnitData } )
if UnitData and UnitData:isExist() then
local UnitName = UnitData:getName()
if not self.PlayersAlive[UnitName] then
self:E( { "Add player for unit:", UnitName, UnitData:getPlayerName() } )
self.PlayersAlive[UnitName] = UnitData:getPlayerName()
end
end
end
end
return self
end
--- Private method that registers all datapoints within in the mission.
-- @param #SET self
-- @return #SET self
function SET:_RegisterDatabase()
local CoalitionsData = { AlivePlayersRed = coalition.getGroups( coalition.side.RED ), AlivePlayersBlue = coalition.getGroups( coalition.side.BLUE ) }
for CoalitionId, CoalitionData in pairs( CoalitionsData ) do
for DCSGroupId, DCSGroup in pairs( CoalitionData ) do
if DCSGroup:isExist() then
local DCSGroupName = DCSGroup:getName()
self:E( { "Register Group:", DCSGroup, DCSGroupName } )
self.DCSGroups[DCSGroupName] = DCSGroup
self.Groups[DCSGroupName] = GROUP:New( DCSGroup )
if self:_IsAliveDCSGroup(DCSGroup) then
self:E( { "Register Alive Group:", DCSGroup, DCSGroupName } )
self.DCSGroupsAlive[DCSGroupName] = DCSGroup
self.GroupsAlive[DCSGroupName] = self.Groups[DCSGroupName]
end
for DCSUnitId, DCSUnit in pairs( DCSGroup:getUnits() ) do
local DCSUnitName = DCSUnit:getName()
self:E( { "Register Unit:", DCSUnit, DCSUnitName } )
self.DCSUnits[DCSUnitName] = DCSUnit
self:AddUnit( UNIT:Find( DCSUnit ) )
--self.Units[DCSUnitName] = UNIT:Register( DCSUnit )
if self:_IsAliveDCSUnit(DCSUnit) then
self:E( { "Register Alive Unit:", DCSUnit, DCSUnitName } )
self.DCSUnitsAlive[DCSUnitName] = DCSUnit
self.UnitsAlive[DCSUnitName] = self.Units[DCSUnitName]
end
end
else
self:E( "Group does not exist: " .. DCSGroup )
end
for ClientName, ClientTemplate in pairs( self.Templates.ClientsByName ) do
self.Clients[ClientName] = CLIENT:Find( ClientName )
end
end
end
return self
end
----- Private method that registers all alive players in the mission.
---- @param #SET self
---- @return #SET self
--function SET:_RegisterPlayers()
--
-- local CoalitionsData = { AlivePlayersRed = coalition.getPlayers( coalition.side.RED ), AlivePlayersBlue = coalition.getPlayers( coalition.side.BLUE ) }
-- for CoalitionId, CoalitionData in pairs( CoalitionsData ) do
-- for UnitId, UnitData in pairs( CoalitionData ) do
-- self:T3( { "UnitData:", UnitData } )
-- if UnitData and UnitData:isExist() then
-- local UnitName = UnitData:getName()
-- if not self.PlayersAlive[UnitName] then
-- self:E( { "Add player for unit:", UnitName, UnitData:getPlayerName() } )
-- self.PlayersAlive[UnitName] = UnitData:getPlayerName()
-- end
-- end
-- end
-- end
--
-- return self
--end
--- Events
--- Handles the OnBirth event for the alive units set.
--- Handles the OnBirth event for the Set.
-- @param #SET self
-- @param Event#EVENTDATA Event
function SET:_EventOnBirth( Event )
self:F( { Event } )
self:F3( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
self.DCSUnits[Event.IniDCSUnitName] = Event.IniDCSUnit
self.DCSUnitsAlive[Event.IniDCSUnitName] = Event.IniDCSUnit
self:AddUnit( UNIT:Register( Event.IniDCSUnit ) )
--self.Units[Event.IniDCSUnitName] = UNIT:Register( Event.IniDCSUnit )
--if not self.DCSGroups[Event.IniDCSGroupName] then
-- self.DCSGroups[Event.IniDCSGroupName] = Event.IniDCSGroupName
-- self.DCSGroupsAlive[Event.IniDCSGroupName] = Event.IniDCSGroupName
-- self.Groups[Event.IniDCSGroupName] = GROUP:New( Event.IniDCSGroup )
--end
self:_EventOnPlayerEnterUnit( Event )
local ObjectName, Object = self:AddInDatabase( Event )
self:T3( ObjectName, Object )
if self:IsIncludeObject( Object ) then
self:_Add( ObjectName, Object )
--self:_EventOnPlayerEnterUnit( Event )
end
end
end
@ -448,49 +186,49 @@ end
-- @param #SET self
-- @param Event#EVENTDATA Event
function SET:_EventOnDeadOrCrash( Event )
self:F( { Event } )
self:F3( { Event } )
if Event.IniDCSUnit then
if self.DCSUnitsAlive[Event.IniDCSUnitName] then
self.DCSUnits[Event.IniDCSUnitName] = nil
self.DCSUnitsAlive[Event.IniDCSUnitName] = nil
local ObjectName, Object = self:FindInDatabase( Event )
if ObjectName and Object then
self:_Delete( ObjectName )
end
end
end
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
-- @param #SET self
-- @param Event#EVENTDATA Event
function SET:_EventOnPlayerEnterUnit( Event )
self:F( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
if not self.PlayersAlive[Event.IniDCSUnitName] then
self:E( { "Add player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
self.PlayersAlive[Event.IniDCSUnitName] = Event.IniDCSUnit:getPlayerName()
self.ClientsAlive[Event.IniDCSUnitName] = _DATABASE.Clients[ Event.IniDCSUnitName ]
end
end
end
end
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
-- @param #SET self
-- @param Event#EVENTDATA Event
function SET:_EventOnPlayerLeaveUnit( Event )
self:F( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
if self.PlayersAlive[Event.IniDCSUnitName] then
self:E( { "Cleaning player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
self.PlayersAlive[Event.IniDCSUnitName] = nil
self.ClientsAlive[Event.IniDCSUnitName] = nil
end
end
end
end
----- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
---- @param #SET self
---- @param Event#EVENTDATA Event
--function SET:_EventOnPlayerEnterUnit( Event )
-- self:F3( { Event } )
--
-- if Event.IniDCSUnit then
-- if self:IsIncludeObject( Event.IniDCSUnit ) then
-- if not self.PlayersAlive[Event.IniDCSUnitName] then
-- self:E( { "Add player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
-- self.PlayersAlive[Event.IniDCSUnitName] = Event.IniDCSUnit:getPlayerName()
-- self.ClientsAlive[Event.IniDCSUnitName] = _DATABASE.Clients[ Event.IniDCSUnitName ]
-- end
-- end
-- end
--end
--
----- Handles the OnPlayerLeaveUnit event to clean the active players table.
---- @param #SET self
---- @param Event#EVENTDATA Event
--function SET:_EventOnPlayerLeaveUnit( Event )
-- self:F3( { Event } )
--
-- if Event.IniDCSUnit then
-- if self:IsIncludeObject( Event.IniDCSUnit ) then
-- if self.PlayersAlive[Event.IniDCSUnitName] then
-- self:E( { "Cleaning player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
-- self.PlayersAlive[Event.IniDCSUnitName] = nil
-- self.ClientsAlive[Event.IniDCSUnitName] = nil
-- end
-- end
-- end
--end
--- Iterators
@ -499,7 +237,7 @@ end
-- @param #function IteratorFunction The function that will be called when there is an alive player in the SET.
-- @return #SET self
function SET:ForEach( IteratorFunction, arg, Set )
self:F( arg )
self:F3( arg )
local function CoRoutine()
local Count = 0
@ -519,7 +257,7 @@ function SET:ForEach( IteratorFunction, arg, Set )
local function Schedule()
local status, res = coroutine.resume( co )
self:T( { status, res } )
self:T3( { status, res } )
if status == false then
error( res )
@ -537,222 +275,67 @@ function SET:ForEach( IteratorFunction, arg, Set )
end
--- Interate the SET and call an interator function for each **alive** unit, providing the Unit and optional parameters.
----- Interate the SET and call an interator function for each **alive** unit, providing the Unit and optional parameters.
---- @param #SET self
---- @param #function IteratorFunction The function that will be called when there is an alive unit in the SET. The function needs to accept a UNIT parameter.
---- @return #SET self
--function SET:ForEachDCSUnitAlive( IteratorFunction, ... )
-- self:F3( arg )
--
-- self:ForEach( IteratorFunction, arg, self.DCSUnitsAlive )
--
-- return self
--end
--
----- Interate the SET and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
---- @param #SET self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET. The function needs to accept a UNIT parameter.
---- @return #SET self
--function SET:ForEachPlayer( IteratorFunction, ... )
-- self:F3( arg )
--
-- self:ForEach( IteratorFunction, arg, self.PlayersAlive )
--
-- return self
--end
--
--
----- Interate the SET and call an interator function for each client, providing the Client to the function and optional parameters.
---- @param #SET self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET. The function needs to accept a CLIENT parameter.
---- @return #SET self
--function SET:ForEachClient( IteratorFunction, ... )
-- self:F3( arg )
--
-- self:ForEach( IteratorFunction, arg, self.Clients )
--
-- return self
--end
--- Decides whether to include the Object
-- @param #SET self
-- @param #function IteratorFunction The function that will be called when there is an alive unit in the SET. The function needs to accept a UNIT parameter.
-- @param #table Object
-- @return #SET self
function SET:ForEachDCSUnitAlive( IteratorFunction, ... )
self:F( arg )
function SET:IsIncludeObject( Object )
self:F3( Object )
self:ForEach( IteratorFunction, arg, self.DCSUnitsAlive )
return self
return true
end
--- Interate the SET and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
--- Flushes the current SET contents in the log ... (for debug reasons).
-- @param #SET self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the SET. The function needs to accept a UNIT parameter.
-- @return #SET self
function SET:ForEachPlayer( IteratorFunction, ... )
self:F( arg )
-- @return #string A string with the names of the objects.
function SET:Flush()
self:F3()
local ObjectNames = ""
for ObjectName, Object in pairs( self.Set ) do
ObjectNames = ObjectNames .. ObjectName .. ", "
end
self:T( { "Objects in Set:", ObjectNames } )
self:ForEach( IteratorFunction, arg, self.PlayersAlive )
return self
end
--- Interate the SET and call an interator function for each client, providing the Client to the function and optional parameters.
-- @param #SET self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the SET. The function needs to accept a CLIENT parameter.
-- @return #SET self
function SET:ForEachClient( IteratorFunction, ... )
self:F( arg )
self:ForEach( IteratorFunction, arg, self.Clients )
return self
end
function SET:ScanEnvironment()
self:F()
self.Navpoints = {}
self.Units = {}
--Build routines.db.units and self.Navpoints
for coa_name, coa_data in pairs(env.mission.coalition) do
if (coa_name == 'red' or coa_name == 'blue') and type(coa_data) == 'table' then
--self.Units[coa_name] = {}
----------------------------------------------
-- build nav points DB
self.Navpoints[coa_name] = {}
if coa_data.nav_points then --navpoints
for nav_ind, nav_data in pairs(coa_data.nav_points) do
if type(nav_data) == 'table' then
self.Navpoints[coa_name][nav_ind] = routines.utils.deepCopy(nav_data)
self.Navpoints[coa_name][nav_ind]['name'] = nav_data.callsignStr -- name is a little bit more self-explanatory.
self.Navpoints[coa_name][nav_ind]['point'] = {} -- point is used by SSE, support it.
self.Navpoints[coa_name][nav_ind]['point']['x'] = nav_data.x
self.Navpoints[coa_name][nav_ind]['point']['y'] = 0
self.Navpoints[coa_name][nav_ind]['point']['z'] = nav_data.y
end
end
end
-------------------------------------------------
if coa_data.country then --there is a country table
for cntry_id, cntry_data in pairs(coa_data.country) do
local countryName = string.lower(cntry_data.name)
--self.Units[coa_name][countryName] = {}
--self.Units[coa_name][countryName]["countryId"] = cntry_data.id
if type(cntry_data) == 'table' then --just making sure
for obj_type_name, obj_type_data in pairs(cntry_data) do
if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" or obj_type_name == "static" then --should be an unncessary check
local category = obj_type_name
if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group!
--self.Units[coa_name][countryName][category] = {}
for group_num, GroupTemplate in pairs(obj_type_data.group) do
if GroupTemplate and GroupTemplate.units and type(GroupTemplate.units) == 'table' then --making sure again- this is a valid group
self:_RegisterGroup( GroupTemplate )
end --if GroupTemplate and GroupTemplate.units then
end --for group_num, GroupTemplate in pairs(obj_type_data.group) do
end --if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
end --if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" or obj_type_name == "static" then
end --for obj_type_name, obj_type_data in pairs(cntry_data) do
end --if type(cntry_data) == 'table' then
end --for cntry_id, cntry_data in pairs(coa_data.country) do
end --if coa_data.country then --there is a country table
end --if coa_name == 'red' or coa_name == 'blue' and type(coa_data) == 'table' then
end --for coa_name, coa_data in pairs(mission.coalition) do
self:_RegisterDatabase()
self:_RegisterPlayers()
return self
end
---
-- @param #SET self
-- @param DCSUnit#Unit DCSUnit
-- @return #SET self
function SET:_IsIncludeDCSUnit( DCSUnit )
self:F( DCSUnit )
local DCSUnitInclude = true
if self.Filter.Coalitions then
local DCSUnitCoalition = false
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
self:T( { "Coalition:", DCSUnit:getCoalition(), self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == DCSUnit:getCoalition() then
DCSUnitCoalition = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCoalition
end
if self.Filter.Categories then
local DCSUnitCategory = false
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
self:T( { "Category:", DCSUnit:getDesc().category, self.FilterMeta.Categories[CategoryName], CategoryName } )
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == DCSUnit:getDesc().category then
DCSUnitCategory = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCategory
end
if self.Filter.Types then
local DCSUnitType = false
for TypeID, TypeName in pairs( self.Filter.Types ) do
self:T( { "Type:", DCSUnit:getTypeName(), TypeName } )
if TypeName == DCSUnit:getTypeName() then
DCSUnitType = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitType
end
if self.Filter.Countries then
local DCSUnitCountry = false
for CountryID, CountryName in pairs( self.Filter.Countries ) do
self:T( { "Country:", DCSUnit:getCountry(), CountryName } )
if country.id[CountryName] == DCSUnit:getCountry() then
DCSUnitCountry = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCountry
end
if self.Filter.UnitPrefixes then
local DCSUnitPrefix = false
for UnitPrefixId, UnitPrefix in pairs( self.Filter.UnitPrefixes ) do
self:T( { "Unit Prefix:", string.find( DCSUnit:getName(), UnitPrefix, 1 ), UnitPrefix } )
if string.find( DCSUnit:getName(), UnitPrefix, 1 ) then
DCSUnitPrefix = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitPrefix
end
self:T( DCSUnitInclude )
return DCSUnitInclude
end
---
-- @param #SET self
-- @param DCSUnit#Unit DCSUnit
-- @return #SET self
function SET:_IsAliveDCSUnit( DCSUnit )
self:F( DCSUnit )
local DCSUnitAlive = false
if DCSUnit and DCSUnit:isExist() and DCSUnit:isActive() then
if self.DCSUnits[DCSUnit:getName()] then
DCSUnitAlive = true
end
end
self:T( DCSUnitAlive )
return DCSUnitAlive
end
---
-- @param #SET self
-- @param DCSGroup#Group DCSGroup
-- @return #SET self
function SET:_IsAliveDCSGroup( DCSGroup )
self:F( DCSGroup )
local DCSGroupAlive = false
if DCSGroup and DCSGroup:isExist() then
if self.DCSGroups[DCSGroup:getName()] then
DCSGroupAlive = true
end
end
self:T( DCSGroupAlive )
return DCSGroupAlive
end
--- Traces the current SET contents in the log ... (for debug reasons).
-- @param #SET self
-- @return #SET self
function SET:TraceDatabase()
self:F()
self:T( { "DCSUnits:", self.DCSUnits } )
self:T( { "DCSUnitsAlive:", self.DCSUnitsAlive } )
return ObjectNames
end

View File

@ -0,0 +1,363 @@
--- Create and manage a set of units.
--
-- @{#UNITSET} class
-- ==================
-- Mission designers can use the UNITSET class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
--
-- UNITSET construction methods:
-- =================================
-- Create a new UNITSET object with the @{#UNITSET.New} method:
--
-- * @{#UNITSET.New}: Creates a new UNITSET object.
--
--
-- UNITSET filter criteria:
-- =========================
-- You can set filter criteria to define the set of units within the UNITSET.
-- Filter criteria are defined by:
--
-- * @{#UNITSET.FilterCoalitions}: Builds the UNITSET with the units belonging to the coalition(s).
-- * @{#UNITSET.FilterCategories}: Builds the UNITSET with the units belonging to the category(ies).
-- * @{#UNITSET.FilterTypes}: Builds the UNITSET with the units belonging to the unit type(s).
-- * @{#UNITSET.FilterCountries}: Builds the UNITSET with the units belonging to the country(ies).
-- * @{#UNITSET.FilterPrefixes}: Builds the UNITSET with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the UNITSET, you can start filtering using:
--
-- * @{#UNITSET.FilterStart}: Starts the filtering of the units within the UNITSET.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#UNITSET.FilterZones}: Builds the UNITSET with the units within a @{Zone#ZONE}.
--
--
-- UNITSET iterators:
-- ===================
-- Once the filters have been defined and the UNITSET has been built, you can iterate the UNITSET with the available iterator methods.
-- The iterator methods will walk the UNITSET set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the UNITSET:
--
-- * @{#UNITSET.ForEachUnit}: Calls a function for each alive unit it finds within the UNITSET.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#UNITSET.ForEachUnitInGroup}: Calls a function for each group contained within the UNITSET.
-- * @{#UNITSET.ForEachUnitInZone}: Calls a function for each unit within a certain zone contained within the UNITSET.
--
-- @module UnitSet
-- @author FlightControl
Include.File( "Routines" )
Include.File( "Base" )
Include.File( "Unit" )
Include.File( "Set" )
--- UNITSET class
-- @type UNITSET
-- @extends Set#SET
UNITSET = {
ClassName = "UNITSET",
Units = {},
Filter = {
Coalitions = nil,
Categories = nil,
Types = nil,
Countries = nil,
UnitPrefixes = nil,
},
FilterMeta = {
Coalitions = {
red = coalition.side.RED,
blue = coalition.side.BLUE,
neutral = coalition.side.NEUTRAL,
},
Categories = {
plane = Unit.Category.AIRPLANE,
helicopter = Unit.Category.HELICOPTER,
ground = Unit.Category.GROUND_UNIT,
ship = Unit.Category.SHIP,
structure = Unit.Category.STRUCTURE,
},
},
}
--- Creates a new UNITSET object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.
-- @param #UNITSET self
-- @return #UNITSET
-- @usage
-- -- Define a new UNITSET Object. This DBObject will contain a reference to all alive Units.
-- DBObject = UNITSET:New()
function UNITSET:New()
-- Inherits from BASE
local self = BASE:Inherit( self, SET:New( _DATABASE.UNITS ) )
return self
end
--- Finds a Unit based on the Unit Name.
-- @param #UNITSET self
-- @param #string UnitName
-- @return Unit#UNIT The found Unit.
function UNITSET:FindUnit( UnitName )
local UnitFound = self.Set[UnitName]
return UnitFound
end
--- Builds a set of units of coalitions.
-- Possible current coalitions are red, blue and neutral.
-- @param #UNITSET self
-- @param #string Coalitions Can take the following values: "red", "blue", "neutral".
-- @return #UNITSET self
function UNITSET:FilterCoalitions( Coalitions )
if not self.Filter.Coalitions then
self.Filter.Coalitions = {}
end
if type( Coalitions ) ~= "table" then
Coalitions = { Coalitions }
end
for CoalitionID, Coalition in pairs( Coalitions ) do
self.Filter.Coalitions[Coalition] = Coalition
end
return self
end
--- Builds a set of units out of categories.
-- Possible current categories are plane, helicopter, ground, ship.
-- @param #UNITSET self
-- @param #string Categories Can take the following values: "plane", "helicopter", "ground", "ship".
-- @return #UNITSET self
function UNITSET:FilterCategories( Categories )
if not self.Filter.Categories then
self.Filter.Categories = {}
end
if type( Categories ) ~= "table" then
Categories = { Categories }
end
for CategoryID, Category in pairs( Categories ) do
self.Filter.Categories[Category] = Category
end
return self
end
--- Builds a set of units of defined unit types.
-- Possible current types are those types known within DCS world.
-- @param #UNITSET self
-- @param #string Types Can take those type strings known within DCS world.
-- @return #UNITSET self
function UNITSET:FilterTypes( Types )
if not self.Filter.Types then
self.Filter.Types = {}
end
if type( Types ) ~= "table" then
Types = { Types }
end
for TypeID, Type in pairs( Types ) do
self.Filter.Types[Type] = Type
end
return self
end
--- Builds a set of units of defined countries.
-- Possible current countries are those known within DCS world.
-- @param #UNITSET self
-- @param #string Countries Can take those country strings known within DCS world.
-- @return #UNITSET self
function UNITSET:FilterCountries( Countries )
if not self.Filter.Countries then
self.Filter.Countries = {}
end
if type( Countries ) ~= "table" then
Countries = { Countries }
end
for CountryID, Country in pairs( Countries ) do
self.Filter.Countries[Country] = Country
end
return self
end
--- Builds a set of units of defined unit prefixes.
-- All the units starting with the given prefixes will be included within the set.
-- @param #UNITSET self
-- @param #string Prefixes The prefix of which the unit name starts with.
-- @return #UNITSET self
function UNITSET:FilterPrefixes( Prefixes )
if not self.Filter.UnitPrefixes then
self.Filter.UnitPrefixes = {}
end
if type( Prefixes ) ~= "table" then
Prefixes = { Prefixes }
end
for PrefixID, Prefix in pairs( Prefixes ) do
self.Filter.UnitPrefixes[Prefix] = Prefix
end
return self
end
--- Starts the filtering.
-- @param #UNITSET self
-- @return #UNITSET self
function UNITSET:FilterStart()
if _DATABASE then
self:_FilterStart()
end
return self
end
--- Handles the Database to check on an event (birth) that the Object was added in the Database.
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET birth event!
-- @param #UNITSET self
-- @param Event#EVENTDATA Event
-- @return #string The name of the UNIT
-- @return #table The UNIT
function UNITSET:AddInDatabase( Event )
self:F3( { Event } )
if not self.Database[Event.IniDCSUnitName] then
self.Database[Event.IniDCSUnitName] = UNIT:Register( Event.IniDCSUnitName )
self:T3( self.Database[Event.IniDCSUnitName] )
end
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
end
--- Handles the Database to check on any event that Object exists in the Database.
-- This is required, because sometimes the _DATABASE event gets called later than the SET event or vise versa!
-- @param #UNITSET self
-- @param Event#EVENTDATA Event
-- @return #string The name of the UNIT
-- @return #table The UNIT
function UNITSET:FindInDatabase( Event )
self:F3( { Event } )
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
end
--- Interate the UNITSET and call an interator function for each **alive** UNIT, providing the UNIT and optional parameters.
-- @param #UNITSET self
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the UNITSET. The function needs to accept a UNIT parameter.
-- @return #UNITSET self
function UNITSET:ForEachUnit( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.Set )
return self
end
----- Interate the UNITSET and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
---- @param #UNITSET self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the UNITSET. The function needs to accept a UNIT parameter.
---- @return #UNITSET self
--function UNITSET:ForEachPlayer( IteratorFunction, ... )
-- self:F2( arg )
--
-- self:ForEach( IteratorFunction, arg, self.PlayersAlive )
--
-- return self
--end
--
--
----- Interate the UNITSET and call an interator function for each client, providing the Client to the function and optional parameters.
---- @param #UNITSET self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the UNITSET. The function needs to accept a CLIENT parameter.
---- @return #UNITSET self
--function UNITSET:ForEachClient( IteratorFunction, ... )
-- self:F2( arg )
--
-- self:ForEach( IteratorFunction, arg, self.Clients )
--
-- return self
--end
---
-- @param #UNITSET self
-- @param Unit#UNIT MUnit
-- @return #UNITSET self
function UNITSET:IsIncludeObject( MUnit )
self:F2( MUnit )
local MUnitInclude = true
if self.Filter.Coalitions then
local MUnitCoalition = false
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
self:T3( { "Coalition:", MUnit:GetCoalition(), self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == MUnit:GetCoalition() then
MUnitCoalition = true
end
end
MUnitInclude = MUnitInclude and MUnitCoalition
end
if self.Filter.Categories then
local MUnitCategory = false
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
self:T3( { "Category:", MUnit:GetDesc().category, self.FilterMeta.Categories[CategoryName], CategoryName } )
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == MUnit:GetDesc().category then
MUnitCategory = true
end
end
MUnitInclude = MUnitInclude and MUnitCategory
end
if self.Filter.Types then
local MUnitType = false
for TypeID, TypeName in pairs( self.Filter.Types ) do
self:T3( { "Type:", MUnit:GetTypeName(), TypeName } )
if TypeName == MUnit:GetTypeName() then
MUnitType = true
end
end
MUnitInclude = MUnitInclude and MUnitType
end
if self.Filter.Countries then
local MUnitCountry = false
for CountryID, CountryName in pairs( self.Filter.Countries ) do
self:T3( { "Country:", MUnit:GetCountry(), CountryName } )
if country.id[CountryName] == MUnit:GetCountry() then
MUnitCountry = true
end
end
MUnitInclude = MUnitInclude and MUnitCountry
end
if self.Filter.UnitPrefixes then
local MUnitPrefix = false
for UnitPrefixId, UnitPrefix in pairs( self.Filter.UnitPrefixes ) do
self:T3( { "Prefix:", string.find( MUnit:GetName(), UnitPrefix, 1 ), UnitPrefix } )
if string.find( MUnit:GetName(), UnitPrefix, 1 ) then
MUnitPrefix = true
end
end
MUnitInclude = MUnitInclude and MUnitPrefix
end
self:T2( MUnitInclude )
return MUnitInclude
end

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20160526_1413' )
env.info( 'Moose Generation Timestamp: 20160527_1334' )
local base = _G
env.info("Loading MOOSE " .. base.timer.getAbsTime() )
@ -3037,7 +3037,10 @@ function BASE:E( Arguments )
end
local LineCurrent = DebugInfoCurrent.currentline
local LineFrom = DebugInfoFrom.currentline
local LineFrom = -1
if DebugInfoFrom then
LineFrom = DebugInfoFrom.currentline
end
env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) )
end
@ -3252,7 +3255,7 @@ local _EVENTCODES = {
function EVENT:New()
local self = BASE:Inherit( self, BASE:New() )
self:F()
self:F2()
self.EventHandler = world.addEventHandler( self )
return self
end
@ -3342,7 +3345,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnBirthForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnBirthForUnit )
@ -3355,7 +3358,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnBirth( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_BIRTH )
@ -3369,7 +3372,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnBirthForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_BIRTH )
@ -3383,7 +3386,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnCrashForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnCrashForUnit )
@ -3396,7 +3399,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnCrash( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_CRASH )
@ -3410,7 +3413,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnCrashForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_CRASH )
@ -3424,7 +3427,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnDeadForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnDeadForUnit )
@ -3437,7 +3440,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnDead( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_DEAD )
@ -3452,7 +3455,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnDeadForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_DEAD )
@ -3466,7 +3469,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnPilotDeadForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_PILOT_DEAD )
@ -3480,7 +3483,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnLandForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnLandForUnit )
@ -3494,7 +3497,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnLandForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_LAND )
@ -3508,7 +3511,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnTakeOffForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnTakeOffForUnit )
@ -3522,7 +3525,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnTakeOffForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_TAKEOFF )
@ -3536,7 +3539,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnEngineShutDownForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnEngineShutDownForUnit )
@ -3550,7 +3553,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnEngineShutDownForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_ENGINE_SHUTDOWN )
@ -3564,7 +3567,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnEngineStartUpForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_ENGINE_STARTUP )
@ -3577,7 +3580,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnShot( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_SHOT )
@ -3591,7 +3594,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnShotForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_SHOT )
@ -3604,7 +3607,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnHit( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_HIT )
@ -3618,7 +3621,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnHitForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_HIT )
@ -3631,7 +3634,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnPlayerEnterUnit( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_PLAYER_ENTER_UNIT )
@ -3644,7 +3647,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnPlayerLeaveUnit( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_PLAYER_LEAVE_UNIT )
@ -3654,7 +3657,7 @@ end
function EVENT:onEvent( Event )
self:F( { _EVENTCODES[Event.id], Event } )
self:F2( { _EVENTCODES[Event.id], Event } )
if self and self.Events and self.Events[Event.id] then
if Event.initiator and Event.initiator:getCategory() == Object.Category.UNIT then
@ -4268,6 +4271,23 @@ function GROUP:GetCoalition()
return nil
end
--- Returns the country of the DCS Group.
-- @param #GROUP self
-- @return DCScountry#country.id The country identifier.
-- @return #nil The DCS Group is not existing or alive.
function GROUP:GetCountry()
self:F2( self.GroupName )
local DCSGroup = self:GetDCSGroup()
if DCSGroup then
local GroupCountry = DCSGroup:getUnit(1):getCountry()
self:T3( GroupCountry )
return GroupCountry
end
return nil
end
--- Returns the name of the DCS Group.
-- @param #GROUP self
-- @return #string The DCS Group name.
@ -7277,67 +7297,37 @@ function CLIENT:Message( Message, MessageDuration, MessageId, MessageCategory, M
end
end
end
--- Manage sets of units and groups.
--- Manage the mission database.
--
-- @{#Database} class
-- @{#DATABASE} class
-- ==================
-- Mission designers can use the DATABASE class to build sets of units belonging to certain:
-- Mission designers can use the DATABASE class to refer to:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
-- * UNITS
-- * GROUPS
-- * players
-- * alive players
-- * CLIENTS
-- * alive CLIENTS
--
-- This list will grow over time. Planned developments are to include filters and iterators.
-- Additional filters will be added around @{Zone#ZONEs}, Radiuses, Active players, ...
-- More iterators will be implemented in the near future ...
--
-- Administers the Initial Sets of the Mission Templates as defined within the Mission Editor.
--
-- DATABASE construction methods:
-- =================================
-- Create a new DATABASE object with the @{#DATABASE.New} method:
--
-- * @{#DATABASE.New}: Creates a new DATABASE object.
--
--
-- DATABASE filter criteria:
-- =========================
-- You can set filter criteria to define the set of units within the database.
-- Filter criteria are defined by:
--
-- * @{#DATABASE.FilterCoalitions}: Builds the DATABASE with the units belonging to the coalition(s).
-- * @{#DATABASE.FilterCategories}: Builds the DATABASE with the units belonging to the category(ies).
-- * @{#DATABASE.FilterTypes}: Builds the DATABASE with the units belonging to the unit type(s).
-- * @{#DATABASE.FilterCountries}: Builds the DATABASE with the units belonging to the country(ies).
-- * @{#DATABASE.FilterUnitPrefixes}: Builds the DATABASE with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the DATABASE, you can start filtering using:
--
-- * @{#DATABASE.FilterStart}: Starts the filtering of the units within the database.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#DATABASE.FilterGroupPrefixes}: Builds the DATABASE with the groups of the units starting with the same prefix string(s).
-- * @{#DATABASE.FilterZones}: Builds the DATABASE with the units within a @{Zone#ZONE}.
-- On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Gruop templates as defined within the Mission Editor.
--
-- Moose will automatically create one instance of the DATABASE class into the **global** object _DATABASE.
-- Moose refers to _DATABASE within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.
--
-- DATABASE iterators:
-- ===================
-- Once the filters have been defined and the DATABASE has been built, you can iterate the database with the available iterator methods.
-- You can iterate the database with the available iterator methods.
-- The iterator methods will walk the DATABASE set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the DATABASE:
--
-- * @{#DATABASE.ForEachAliveUnit}: Calls a function for each alive unit it finds within the DATABASE.
-- * @{#DATABASE.ForEachUnit}: Calls a function for each @{UNIT} it finds within the DATABASE.
-- * @{#DATABASE.ForEachGroup}: Calls a function for each @{GROUP} it finds within the DATABASE.
-- * @{#DATABASE.ForEachPlayer}: Calls a function for each player it finds within the DATABASE.
-- * @{#DATABASE.ForEachPlayerAlive}: Calls a function for each alive player it finds within the DATABASE.
-- * @{#DATABASE.ForEachClient}: Calls a function for each @{CLIENT} it finds within the DATABASE.
-- * @{#DATABASE.ForEachClientAlive}: Calls a function for each alive @{CLIENT} it finds within the DATABASE.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#DATABASE.ForEachUnit}: Calls a function for each unit contained within the DATABASE.
-- * @{#DATABASE.ForEachGroup}: Calls a function for each group contained within the DATABASE.
-- * @{#DATABASE.ForEachUnitInZone}: Calls a function for each unit within a certain zone contained within the DATABASE.
--
-- ====
-- @module Database
-- @author FlightControl
@ -7349,6 +7339,7 @@ Include.File( "Unit" )
Include.File( "Event" )
Include.File( "Client" )
--- DATABASE class
-- @type DATABASE
-- @extends Base#BASE
@ -7364,34 +7355,11 @@ DATABASE = {
DCSGroups = {},
UNITS = {},
GROUPS = {},
NavPoints = {},
Statics = {},
Players = {},
PlayersAlive = {},
PLAYERS = {},
PLAYERSALIVE = {},
CLIENTS = {},
ClientsAlive = {},
Filter = {
Coalitions = nil,
Categories = nil,
Types = nil,
Countries = nil,
UnitPrefixes = nil,
GroupPrefixes = nil,
},
FilterMeta = {
Coalitions = {
red = coalition.side.RED,
blue = coalition.side.BLUE,
neutral = coalition.side.NEUTRAL,
},
Categories = {
plane = Unit.Category.AIRPLANE,
helicopter = Unit.Category.HELICOPTER,
ground = Unit.Category.GROUND_UNIT,
ship = Unit.Category.SHIP,
structure = Unit.Category.STRUCTURE,
},
},
CLIENTSALIVE = {},
NavPoints = {},
}
local _DATABASECoalition =
@ -7426,12 +7394,13 @@ function DATABASE:New()
_EVENTDISPATCHER:OnCrash( self._EventOnDeadOrCrash, self )
-- Add database with registered clients and already alive players
-- Follow alive players and clients
_EVENTDISPATCHER:OnPlayerEnterUnit( self._EventOnPlayerEnterUnit, self )
_EVENTDISPATCHER:OnPlayerLeaveUnit( self._EventOnPlayerLeaveUnit, self )
self:_RegisterTemplates()
self:_RegisterDatabase()
self:_RegisterPlayers()
return self
end
@ -7446,6 +7415,7 @@ function DATABASE:FindUnit( UnitName )
return UnitFound
end
--- Adds a Unit based on the Unit Name in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddUnit( DCSUnit, DCSUnitName )
@ -7454,6 +7424,7 @@ function DATABASE:AddUnit( DCSUnit, DCSUnitName )
self.UNITS[DCSUnitName] = UNIT:Register( DCSUnitName )
end
--- Deletes a Unit from the DATABASE based on the Unit Name.
-- @param #DATABASE self
function DATABASE:DeleteUnit( DCSUnitName )
@ -7461,6 +7432,7 @@ function DATABASE:DeleteUnit( DCSUnitName )
self.DCSUnits[DCSUnitName] = nil
end
--- Finds a CLIENT based on the ClientName.
-- @param #DATABASE self
-- @param #string ClientName
@ -7471,6 +7443,7 @@ function DATABASE:FindClient( ClientName )
return ClientFound
end
--- Adds a CLIENT based on the ClientName in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddClient( ClientName )
@ -7479,6 +7452,7 @@ function DATABASE:AddClient( ClientName )
self:E( self.CLIENTS[ClientName]:GetClassNameAndID() )
end
--- Finds a GROUP based on the GroupName.
-- @param #DATABASE self
-- @param #string GroupName
@ -7489,6 +7463,7 @@ function DATABASE:FindGroup( GroupName )
return GroupFound
end
--- Adds a GROUP based on the GroupName in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddGroup( DCSGroup, GroupName )
@ -7497,6 +7472,30 @@ function DATABASE:AddGroup( DCSGroup, GroupName )
self.GROUPS[GroupName] = GROUP:Register( GroupName )
end
--- Adds a player based on the Player Name in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddPlayer( UnitName, PlayerName )
if PlayerName then
self:E( { "Add player for unit:", UnitName, PlayerName } )
self.PLAYERS[PlayerName] = PlayerName
self.PLAYERSALIVE[PlayerName] = PlayerName
self.CLIENTSALIVE[PlayerName] = self:FindClient( UnitName )
end
end
--- Deletes a player from the DATABASE based on the Player Name.
-- @param #DATABASE self
function DATABASE:DeletePlayer( PlayerName )
if PlayerName then
self:E( { "Clean player:", PlayerName } )
self.PLAYERSALIVE[PlayerName] = nil
self.CLIENTSALIVE[PlayerName] = nil
end
end
--- Instantiate new Groups within the DCSRTE.
-- This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined:
-- SpawnCountryID, SpawnCategoryID
@ -7505,9 +7504,9 @@ end
-- @param #table SpawnTemplate
-- @return #DATABASE self
function DATABASE:Spawn( SpawnTemplate )
self:F( SpawnTemplate.name )
self:F2( SpawnTemplate.name )
self:T( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
self:T2( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
-- Copy the spawn variables of the template in temporary storage, nullify, and restore the spawn variables.
local SpawnCoalitionID = SpawnTemplate.SpawnCoalitionID
@ -7519,7 +7518,7 @@ function DATABASE:Spawn( SpawnTemplate )
SpawnTemplate.SpawnCountryID = nil
SpawnTemplate.SpawnCategoryID = nil
self:_RegisterGroup( SpawnTemplate )
self:_RegisterTemplate( SpawnTemplate )
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
-- Restore
@ -7532,18 +7531,16 @@ function DATABASE:Spawn( SpawnTemplate )
return SpawnGroup
end
--- Set a status to a Group within the Database, this to check crossing events for example.
function DATABASE:SetStatusGroup( GroupName, Status )
self:F( Status )
self:F2( Status )
self.Templates.Groups[GroupName].Status = Status
end
--- Get a status to a Group within the Database, this to check crossing events for example.
function DATABASE:GetStatusGroup( GroupName )
self:F( Status )
self:F2( Status )
if self.Templates.Groups[GroupName] then
return self.Templates.Groups[GroupName].Status
@ -7552,11 +7549,12 @@ function DATABASE:GetStatusGroup( GroupName )
end
end
--- Private method that registers new Group Templates within the DATABASE Object.
-- @param #DATABASE self
-- @param #table GroupTemplate
-- @return #DATABASE self
function DATABASE:_RegisterGroup( GroupTemplate )
function DATABASE:_RegisterTemplate( GroupTemplate )
local GroupTemplateName = env.getValueDictByKey(GroupTemplate.name)
@ -7576,7 +7574,7 @@ function DATABASE:_RegisterGroup( GroupTemplate )
self.Templates.Groups[GroupTemplateName].UnitCount = #GroupTemplate.units
self.Templates.Groups[GroupTemplateName].Units = GroupTemplate.units
self:T( { "Group", self.Templates.Groups[GroupTemplateName].GroupName, self.Templates.Groups[GroupTemplateName].UnitCount } )
self:T2( { "Group", self.Templates.Groups[GroupTemplateName].GroupName, self.Templates.Groups[GroupTemplateName].UnitCount } )
for unit_num, UnitTemplate in pairs( GroupTemplate.units ) do
@ -7596,6 +7594,7 @@ function DATABASE:_RegisterGroup( GroupTemplate )
end
end
--- Private method that registers all alive players in the mission.
-- @param #DATABASE self
-- @return #DATABASE self
@ -7607,9 +7606,10 @@ function DATABASE:_RegisterPlayers()
self:T3( { "UnitData:", UnitData } )
if UnitData and UnitData:isExist() then
local UnitName = UnitData:getName()
if not self.PlayersAlive[UnitName] then
self:E( { "Add player for unit:", UnitName, UnitData:getPlayerName() } )
self.PlayersAlive[UnitName] = UnitData:getPlayerName()
local PlayerName = UnitData:getPlayerName()
if not self.PLAYERS[PlayerName] then
self:E( { "Add player for unit:", UnitName, PlayerName } )
self:AddPlayer( UnitName, PlayerName )
end
end
end
@ -7618,6 +7618,7 @@ function DATABASE:_RegisterPlayers()
return self
end
--- Private method that registers all datapoints within in the mission.
-- @param #DATABASE self
-- @return #DATABASE self
@ -7660,22 +7661,21 @@ end
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnBirth( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
self:AddUnit( Event.IniDCSUnit, Event.IniDCSUnitName )
self:AddGroup( Event.IniDCSGroup, Event.IniDCSGroupName )
self:_EventOnPlayerEnterUnit( Event )
end
self:AddUnit( Event.IniDCSUnit, Event.IniDCSUnitName )
self:AddGroup( Event.IniDCSGroup, Event.IniDCSGroupName )
self:_EventOnPlayerEnterUnit( Event )
end
end
--- Handles the OnDead or OnCrash event for alive units set.
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnDeadOrCrash( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self.DCSUnits[Event.IniDCSUnitName] then
@ -7685,48 +7685,44 @@ function DATABASE:_EventOnDeadOrCrash( Event )
end
end
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnPlayerEnterUnit( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
if not self.PlayersAlive[Event.IniDCSUnitName] then
self:E( { "Add player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
self.PlayersAlive[Event.IniDCSUnitName] = Event.IniDCSUnit:getPlayerName()
self.ClientsAlive[Event.IniDCSUnitName] = self.CLIENTS[ Event.IniDCSUnitName ]
end
local PlayerName = Event.IniDCSUnit:getPlayerName()
if not self.PLAYERSALIVE[PlayerName] then
self:AddPlayer( Event.IniDCSUnitName, PlayerName )
end
end
end
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnPlayerLeaveUnit( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
if self.PlayersAlive[Event.IniDCSUnitName] then
self:E( { "Cleaning player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
self.PlayersAlive[Event.IniDCSUnitName] = nil
self.ClientsAlive[Event.IniDCSUnitName] = nil
end
local PlayerName = Event.IniDCSUnit:getPlayerName()
if self.PLAYERSALIVE[PlayerName] then
self:DeletePlayer( PlayerName )
end
end
end
--- Iterators
--- Interate the DATABASE and call an interator function for the given set, providing the Object for each element within the set and optional parameters.
--- Iterate the DATABASE and call an iterator function for the given set, providing the Object for each element within the set and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database.
-- @return #DATABASE self
function DATABASE:ForEach( IteratorFunction, arg, Set )
self:F( arg )
self:F2( arg )
local function CoRoutine()
local Count = 0
@ -7746,7 +7742,7 @@ function DATABASE:ForEach( IteratorFunction, arg, Set )
local function Schedule()
local status, res = coroutine.resume( co )
self:T( { status, res } )
self:T2( { status, res } )
if status == false then
error( res )
@ -7764,46 +7760,96 @@ function DATABASE:ForEach( IteratorFunction, arg, Set )
end
--- Interate the DATABASE and call an interator function for each **alive** unit, providing the Unit and optional parameters.
--- Iterate the DATABASE and call an iterator function for each **alive** unit, providing the DCSUnit and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive unit in the database. The function needs to accept a UNIT parameter.
-- @param #function IteratorFunction The function that will be called when there is an alive unit in the database. The function needs to accept a DCSUnit parameter.
-- @return #DATABASE self
function DATABASE:ForEachDCSUnit( IteratorFunction, ... )
self:F( arg )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.DCSUnits )
return self
end
--- Interate the DATABASE and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
--- Iterate the DATABASE and call an iterator function for each **alive** UNIT, providing the UNIT and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a UNIT parameter.
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the database. The function needs to accept a UNIT parameter.
-- @return #DATABASE self
function DATABASE:ForEachUnit( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.UNITS )
return self
end
--- Iterate the DATABASE and call an iterator function for each **alive** GROUP, providing the GROUP and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the database. The function needs to accept a GROUP parameter.
-- @return #DATABASE self
function DATABASE:ForEachGroup( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.GROUPS )
return self
end
--- Iterate the DATABASE and call an iterator function for each player, providing the player name and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an player in the database. The function needs to accept the player name.
-- @return #DATABASE self
function DATABASE:ForEachPlayer( IteratorFunction, ... )
self:F( arg )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.PlayersAlive )
self:ForEach( IteratorFunction, arg, self.PLAYERS )
return self
end
--- Interate the DATABASE and call an interator function for each client, providing the Client to the function and optional parameters.
--- Iterate the DATABASE and call an iterator function for each **alive** player, providing the Unit of the player and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a UNIT parameter.
-- @return #DATABASE self
function DATABASE:ForEachPlayerAlive( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.PLAYERSALIVE )
return self
end
--- Iterate the DATABASE and call an iterator function for each CLIENT, providing the CLIENT to the function and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a CLIENT parameter.
-- @return #DATABASE self
function DATABASE:ForEachClient( IteratorFunction, ... )
self:F( arg )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.CLIENTS )
return self
end
--- Iterate the DATABASE and call an iterator function for each **ALIVE** CLIENT, providing the CLIENT to the function and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the database. The function needs to accept a CLIENT parameter.
-- @return #DATABASE self
function DATABASE:ForEachClientAlive( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.CLIENTSALIVE )
function DATABASE:ScanEnvironment()
self:F()
return self
end
function DATABASE:_RegisterTemplates()
self:F2()
self.Navpoints = {}
self.UNITS = {}
@ -7853,7 +7899,7 @@ function DATABASE:ScanEnvironment()
for group_num, GroupTemplate in pairs(obj_type_data.group) do
if GroupTemplate and GroupTemplate.units and type(GroupTemplate.units) == 'table' then --making sure again- this is a valid group
self:_RegisterGroup( GroupTemplate )
self:_RegisterTemplate( GroupTemplate )
end --if GroupTemplate and GroupTemplate.units then
end --for group_num, GroupTemplate in pairs(obj_type_data.group) do
end --if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
@ -7865,121 +7911,10 @@ function DATABASE:ScanEnvironment()
end --if coa_name == 'red' or coa_name == 'blue' and type(coa_data) == 'table' then
end --for coa_name, coa_data in pairs(mission.coalition) do
self:_RegisterDatabase()
self:_RegisterPlayers()
return self
end
---
-- @param #DATABASE self
-- @param DCSUnit#Unit DCSUnit
-- @return #DATABASE self
function DATABASE:_IsIncludeDCSUnit( DCSUnit )
self:F( DCSUnit )
local DCSUnitInclude = true
if self.Filter.Coalitions then
local DCSUnitCoalition = false
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
self:T( { "Coalition:", DCSUnit:getCoalition(), self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == DCSUnit:getCoalition() then
DCSUnitCoalition = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCoalition
end
if self.Filter.Categories then
local DCSUnitCategory = false
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
self:T( { "Category:", DCSUnit:getDesc().category, self.FilterMeta.Categories[CategoryName], CategoryName } )
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == DCSUnit:getDesc().category then
DCSUnitCategory = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCategory
end
if self.Filter.Types then
local DCSUnitType = false
for TypeID, TypeName in pairs( self.Filter.Types ) do
self:T( { "Type:", DCSUnit:getTypeName(), TypeName } )
if TypeName == DCSUnit:getTypeName() then
DCSUnitType = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitType
end
if self.Filter.Countries then
local DCSUnitCountry = false
for CountryID, CountryName in pairs( self.Filter.Countries ) do
self:T( { "Country:", DCSUnit:getCountry(), CountryName } )
if country.id[CountryName] == DCSUnit:getCountry() then
DCSUnitCountry = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCountry
end
if self.Filter.UnitPrefixes then
local DCSUnitPrefix = false
for UnitPrefixId, UnitPrefix in pairs( self.Filter.UnitPrefixes ) do
self:T( { "Unit Prefix:", string.find( DCSUnit:getName(), UnitPrefix, 1 ), UnitPrefix } )
if string.find( DCSUnit:getName(), UnitPrefix, 1 ) then
DCSUnitPrefix = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitPrefix
end
self:T( DCSUnitInclude )
return DCSUnitInclude
end
---
-- @param #DATABASE self
-- @param DCSUnit#Unit DCSUnit
-- @return #DATABASE self
function DATABASE:_IsAliveDCSUnit( DCSUnit )
self:F( DCSUnit )
local DCSUnitAlive = false
if DCSUnit and DCSUnit:isExist() and DCSUnit:isActive() then
if self.DCSUnits[DCSUnit:getName()] then
DCSUnitAlive = true
end
end
self:T( DCSUnitAlive )
return DCSUnitAlive
end
---
-- @param #DATABASE self
-- @param DCSGroup#Group DCSGroup
-- @return #DATABASE self
function DATABASE:_IsAliveDCSGroup( DCSGroup )
self:F( DCSGroup )
local DCSGroupAlive = false
if DCSGroup and DCSGroup:isExist() then
if self.DCSGroups[DCSGroup:getName()] then
DCSGroupAlive = true
end
end
self:T( DCSGroupAlive )
return DCSGroupAlive
end
--- Traces the current database contents in the log ... (for debug reasons).
-- @param #DATABASE self
-- @return #DATABASE self
function DATABASE:TraceDatabase()
self:F()
self:T( { "DCSUnits:", self.DCSUnits } )
end
--- The main include file for the MOOSE system.
@ -7995,7 +7930,7 @@ Include.File( "Event" )
_EVENTDISPATCHER = EVENT:New() -- #EVENT
--- Declare the main database object, which is used internally by the MOOSE classes.
_DATABASE = DATABASE:New():ScanEnvironment() -- Database#DATABASE
_DATABASE = DATABASE:New() -- Database#DATABASE
--- Scoring system for MOOSE.
-- This scoring class calculates the hits and kills that players make within a simulation session.

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20160526_1413' )
env.info( 'Moose Generation Timestamp: 20160527_1334' )
local base = _G
env.info("Loading MOOSE " .. base.timer.getAbsTime() )
@ -3037,7 +3037,10 @@ function BASE:E( Arguments )
end
local LineCurrent = DebugInfoCurrent.currentline
local LineFrom = DebugInfoFrom.currentline
local LineFrom = -1
if DebugInfoFrom then
LineFrom = DebugInfoFrom.currentline
end
env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) )
end
@ -3252,7 +3255,7 @@ local _EVENTCODES = {
function EVENT:New()
local self = BASE:Inherit( self, BASE:New() )
self:F()
self:F2()
self.EventHandler = world.addEventHandler( self )
return self
end
@ -3342,7 +3345,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnBirthForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnBirthForUnit )
@ -3355,7 +3358,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnBirth( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_BIRTH )
@ -3369,7 +3372,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnBirthForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_BIRTH )
@ -3383,7 +3386,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnCrashForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnCrashForUnit )
@ -3396,7 +3399,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnCrash( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_CRASH )
@ -3410,7 +3413,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnCrashForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_CRASH )
@ -3424,7 +3427,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnDeadForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnDeadForUnit )
@ -3437,7 +3440,7 @@ end
-- @param Base#BASE EventSelf
-- @return #EVENT
function EVENT:OnDead( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_DEAD )
@ -3452,7 +3455,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnDeadForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_DEAD )
@ -3466,7 +3469,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnPilotDeadForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_PILOT_DEAD )
@ -3480,7 +3483,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnLandForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnLandForUnit )
@ -3494,7 +3497,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnLandForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_LAND )
@ -3508,7 +3511,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnTakeOffForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnTakeOffForUnit )
@ -3522,7 +3525,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnTakeOffForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_TAKEOFF )
@ -3536,7 +3539,7 @@ end
-- @param EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnEngineShutDownForTemplate( EventTemplate, EventFunction, EventSelf )
self:F( EventTemplate.name )
self:F2( EventTemplate.name )
self:OnEventForTemplate( EventTemplate, EventFunction, EventSelf, self.OnEngineShutDownForUnit )
@ -3550,7 +3553,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnEngineShutDownForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_ENGINE_SHUTDOWN )
@ -3564,7 +3567,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnEngineStartUpForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_ENGINE_STARTUP )
@ -3577,7 +3580,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnShot( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_SHOT )
@ -3591,7 +3594,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnShotForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_SHOT )
@ -3604,7 +3607,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnHit( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_HIT )
@ -3618,7 +3621,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnHitForUnit( EventDCSUnitName, EventFunction, EventSelf )
self:F( EventDCSUnitName )
self:F2( EventDCSUnitName )
self:OnEventForUnit( EventDCSUnitName, EventFunction, EventSelf, world.event.S_EVENT_HIT )
@ -3631,7 +3634,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnPlayerEnterUnit( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_PLAYER_ENTER_UNIT )
@ -3644,7 +3647,7 @@ end
-- @param Base#BASE EventSelf The self instance of the class for which the event is.
-- @return #EVENT
function EVENT:OnPlayerLeaveUnit( EventFunction, EventSelf )
self:F()
self:F2()
self:OnEventGeneric( EventFunction, EventSelf, world.event.S_EVENT_PLAYER_LEAVE_UNIT )
@ -3654,7 +3657,7 @@ end
function EVENT:onEvent( Event )
self:F( { _EVENTCODES[Event.id], Event } )
self:F2( { _EVENTCODES[Event.id], Event } )
if self and self.Events and self.Events[Event.id] then
if Event.initiator and Event.initiator:getCategory() == Object.Category.UNIT then
@ -4268,6 +4271,23 @@ function GROUP:GetCoalition()
return nil
end
--- Returns the country of the DCS Group.
-- @param #GROUP self
-- @return DCScountry#country.id The country identifier.
-- @return #nil The DCS Group is not existing or alive.
function GROUP:GetCountry()
self:F2( self.GroupName )
local DCSGroup = self:GetDCSGroup()
if DCSGroup then
local GroupCountry = DCSGroup:getUnit(1):getCountry()
self:T3( GroupCountry )
return GroupCountry
end
return nil
end
--- Returns the name of the DCS Group.
-- @param #GROUP self
-- @return #string The DCS Group name.
@ -7277,67 +7297,37 @@ function CLIENT:Message( Message, MessageDuration, MessageId, MessageCategory, M
end
end
end
--- Manage sets of units and groups.
--- Manage the mission database.
--
-- @{#Database} class
-- @{#DATABASE} class
-- ==================
-- Mission designers can use the DATABASE class to build sets of units belonging to certain:
-- Mission designers can use the DATABASE class to refer to:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
-- * UNITS
-- * GROUPS
-- * players
-- * alive players
-- * CLIENTS
-- * alive CLIENTS
--
-- This list will grow over time. Planned developments are to include filters and iterators.
-- Additional filters will be added around @{Zone#ZONEs}, Radiuses, Active players, ...
-- More iterators will be implemented in the near future ...
--
-- Administers the Initial Sets of the Mission Templates as defined within the Mission Editor.
--
-- DATABASE construction methods:
-- =================================
-- Create a new DATABASE object with the @{#DATABASE.New} method:
--
-- * @{#DATABASE.New}: Creates a new DATABASE object.
--
--
-- DATABASE filter criteria:
-- =========================
-- You can set filter criteria to define the set of units within the database.
-- Filter criteria are defined by:
--
-- * @{#DATABASE.FilterCoalitions}: Builds the DATABASE with the units belonging to the coalition(s).
-- * @{#DATABASE.FilterCategories}: Builds the DATABASE with the units belonging to the category(ies).
-- * @{#DATABASE.FilterTypes}: Builds the DATABASE with the units belonging to the unit type(s).
-- * @{#DATABASE.FilterCountries}: Builds the DATABASE with the units belonging to the country(ies).
-- * @{#DATABASE.FilterUnitPrefixes}: Builds the DATABASE with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the DATABASE, you can start filtering using:
--
-- * @{#DATABASE.FilterStart}: Starts the filtering of the units within the database.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#DATABASE.FilterGroupPrefixes}: Builds the DATABASE with the groups of the units starting with the same prefix string(s).
-- * @{#DATABASE.FilterZones}: Builds the DATABASE with the units within a @{Zone#ZONE}.
-- On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Gruop templates as defined within the Mission Editor.
--
-- Moose will automatically create one instance of the DATABASE class into the **global** object _DATABASE.
-- Moose refers to _DATABASE within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.
--
-- DATABASE iterators:
-- ===================
-- Once the filters have been defined and the DATABASE has been built, you can iterate the database with the available iterator methods.
-- You can iterate the database with the available iterator methods.
-- The iterator methods will walk the DATABASE set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the DATABASE:
--
-- * @{#DATABASE.ForEachAliveUnit}: Calls a function for each alive unit it finds within the DATABASE.
-- * @{#DATABASE.ForEachUnit}: Calls a function for each @{UNIT} it finds within the DATABASE.
-- * @{#DATABASE.ForEachGroup}: Calls a function for each @{GROUP} it finds within the DATABASE.
-- * @{#DATABASE.ForEachPlayer}: Calls a function for each player it finds within the DATABASE.
-- * @{#DATABASE.ForEachPlayerAlive}: Calls a function for each alive player it finds within the DATABASE.
-- * @{#DATABASE.ForEachClient}: Calls a function for each @{CLIENT} it finds within the DATABASE.
-- * @{#DATABASE.ForEachClientAlive}: Calls a function for each alive @{CLIENT} it finds within the DATABASE.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#DATABASE.ForEachUnit}: Calls a function for each unit contained within the DATABASE.
-- * @{#DATABASE.ForEachGroup}: Calls a function for each group contained within the DATABASE.
-- * @{#DATABASE.ForEachUnitInZone}: Calls a function for each unit within a certain zone contained within the DATABASE.
--
-- ====
-- @module Database
-- @author FlightControl
@ -7349,6 +7339,7 @@ Include.File( "Unit" )
Include.File( "Event" )
Include.File( "Client" )
--- DATABASE class
-- @type DATABASE
-- @extends Base#BASE
@ -7364,34 +7355,11 @@ DATABASE = {
DCSGroups = {},
UNITS = {},
GROUPS = {},
NavPoints = {},
Statics = {},
Players = {},
PlayersAlive = {},
PLAYERS = {},
PLAYERSALIVE = {},
CLIENTS = {},
ClientsAlive = {},
Filter = {
Coalitions = nil,
Categories = nil,
Types = nil,
Countries = nil,
UnitPrefixes = nil,
GroupPrefixes = nil,
},
FilterMeta = {
Coalitions = {
red = coalition.side.RED,
blue = coalition.side.BLUE,
neutral = coalition.side.NEUTRAL,
},
Categories = {
plane = Unit.Category.AIRPLANE,
helicopter = Unit.Category.HELICOPTER,
ground = Unit.Category.GROUND_UNIT,
ship = Unit.Category.SHIP,
structure = Unit.Category.STRUCTURE,
},
},
CLIENTSALIVE = {},
NavPoints = {},
}
local _DATABASECoalition =
@ -7426,12 +7394,13 @@ function DATABASE:New()
_EVENTDISPATCHER:OnCrash( self._EventOnDeadOrCrash, self )
-- Add database with registered clients and already alive players
-- Follow alive players and clients
_EVENTDISPATCHER:OnPlayerEnterUnit( self._EventOnPlayerEnterUnit, self )
_EVENTDISPATCHER:OnPlayerLeaveUnit( self._EventOnPlayerLeaveUnit, self )
self:_RegisterTemplates()
self:_RegisterDatabase()
self:_RegisterPlayers()
return self
end
@ -7446,6 +7415,7 @@ function DATABASE:FindUnit( UnitName )
return UnitFound
end
--- Adds a Unit based on the Unit Name in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddUnit( DCSUnit, DCSUnitName )
@ -7454,6 +7424,7 @@ function DATABASE:AddUnit( DCSUnit, DCSUnitName )
self.UNITS[DCSUnitName] = UNIT:Register( DCSUnitName )
end
--- Deletes a Unit from the DATABASE based on the Unit Name.
-- @param #DATABASE self
function DATABASE:DeleteUnit( DCSUnitName )
@ -7461,6 +7432,7 @@ function DATABASE:DeleteUnit( DCSUnitName )
self.DCSUnits[DCSUnitName] = nil
end
--- Finds a CLIENT based on the ClientName.
-- @param #DATABASE self
-- @param #string ClientName
@ -7471,6 +7443,7 @@ function DATABASE:FindClient( ClientName )
return ClientFound
end
--- Adds a CLIENT based on the ClientName in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddClient( ClientName )
@ -7479,6 +7452,7 @@ function DATABASE:AddClient( ClientName )
self:E( self.CLIENTS[ClientName]:GetClassNameAndID() )
end
--- Finds a GROUP based on the GroupName.
-- @param #DATABASE self
-- @param #string GroupName
@ -7489,6 +7463,7 @@ function DATABASE:FindGroup( GroupName )
return GroupFound
end
--- Adds a GROUP based on the GroupName in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddGroup( DCSGroup, GroupName )
@ -7497,6 +7472,30 @@ function DATABASE:AddGroup( DCSGroup, GroupName )
self.GROUPS[GroupName] = GROUP:Register( GroupName )
end
--- Adds a player based on the Player Name in the DATABASE.
-- @param #DATABASE self
function DATABASE:AddPlayer( UnitName, PlayerName )
if PlayerName then
self:E( { "Add player for unit:", UnitName, PlayerName } )
self.PLAYERS[PlayerName] = PlayerName
self.PLAYERSALIVE[PlayerName] = PlayerName
self.CLIENTSALIVE[PlayerName] = self:FindClient( UnitName )
end
end
--- Deletes a player from the DATABASE based on the Player Name.
-- @param #DATABASE self
function DATABASE:DeletePlayer( PlayerName )
if PlayerName then
self:E( { "Clean player:", PlayerName } )
self.PLAYERSALIVE[PlayerName] = nil
self.CLIENTSALIVE[PlayerName] = nil
end
end
--- Instantiate new Groups within the DCSRTE.
-- This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined:
-- SpawnCountryID, SpawnCategoryID
@ -7505,9 +7504,9 @@ end
-- @param #table SpawnTemplate
-- @return #DATABASE self
function DATABASE:Spawn( SpawnTemplate )
self:F( SpawnTemplate.name )
self:F2( SpawnTemplate.name )
self:T( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
self:T2( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
-- Copy the spawn variables of the template in temporary storage, nullify, and restore the spawn variables.
local SpawnCoalitionID = SpawnTemplate.SpawnCoalitionID
@ -7519,7 +7518,7 @@ function DATABASE:Spawn( SpawnTemplate )
SpawnTemplate.SpawnCountryID = nil
SpawnTemplate.SpawnCategoryID = nil
self:_RegisterGroup( SpawnTemplate )
self:_RegisterTemplate( SpawnTemplate )
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
-- Restore
@ -7532,18 +7531,16 @@ function DATABASE:Spawn( SpawnTemplate )
return SpawnGroup
end
--- Set a status to a Group within the Database, this to check crossing events for example.
function DATABASE:SetStatusGroup( GroupName, Status )
self:F( Status )
self:F2( Status )
self.Templates.Groups[GroupName].Status = Status
end
--- Get a status to a Group within the Database, this to check crossing events for example.
function DATABASE:GetStatusGroup( GroupName )
self:F( Status )
self:F2( Status )
if self.Templates.Groups[GroupName] then
return self.Templates.Groups[GroupName].Status
@ -7552,11 +7549,12 @@ function DATABASE:GetStatusGroup( GroupName )
end
end
--- Private method that registers new Group Templates within the DATABASE Object.
-- @param #DATABASE self
-- @param #table GroupTemplate
-- @return #DATABASE self
function DATABASE:_RegisterGroup( GroupTemplate )
function DATABASE:_RegisterTemplate( GroupTemplate )
local GroupTemplateName = env.getValueDictByKey(GroupTemplate.name)
@ -7576,7 +7574,7 @@ function DATABASE:_RegisterGroup( GroupTemplate )
self.Templates.Groups[GroupTemplateName].UnitCount = #GroupTemplate.units
self.Templates.Groups[GroupTemplateName].Units = GroupTemplate.units
self:T( { "Group", self.Templates.Groups[GroupTemplateName].GroupName, self.Templates.Groups[GroupTemplateName].UnitCount } )
self:T2( { "Group", self.Templates.Groups[GroupTemplateName].GroupName, self.Templates.Groups[GroupTemplateName].UnitCount } )
for unit_num, UnitTemplate in pairs( GroupTemplate.units ) do
@ -7596,6 +7594,7 @@ function DATABASE:_RegisterGroup( GroupTemplate )
end
end
--- Private method that registers all alive players in the mission.
-- @param #DATABASE self
-- @return #DATABASE self
@ -7607,9 +7606,10 @@ function DATABASE:_RegisterPlayers()
self:T3( { "UnitData:", UnitData } )
if UnitData and UnitData:isExist() then
local UnitName = UnitData:getName()
if not self.PlayersAlive[UnitName] then
self:E( { "Add player for unit:", UnitName, UnitData:getPlayerName() } )
self.PlayersAlive[UnitName] = UnitData:getPlayerName()
local PlayerName = UnitData:getPlayerName()
if not self.PLAYERS[PlayerName] then
self:E( { "Add player for unit:", UnitName, PlayerName } )
self:AddPlayer( UnitName, PlayerName )
end
end
end
@ -7618,6 +7618,7 @@ function DATABASE:_RegisterPlayers()
return self
end
--- Private method that registers all datapoints within in the mission.
-- @param #DATABASE self
-- @return #DATABASE self
@ -7660,22 +7661,21 @@ end
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnBirth( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
self:AddUnit( Event.IniDCSUnit, Event.IniDCSUnitName )
self:AddGroup( Event.IniDCSGroup, Event.IniDCSGroupName )
self:_EventOnPlayerEnterUnit( Event )
end
self:AddUnit( Event.IniDCSUnit, Event.IniDCSUnitName )
self:AddGroup( Event.IniDCSGroup, Event.IniDCSGroupName )
self:_EventOnPlayerEnterUnit( Event )
end
end
--- Handles the OnDead or OnCrash event for alive units set.
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnDeadOrCrash( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self.DCSUnits[Event.IniDCSUnitName] then
@ -7685,48 +7685,44 @@ function DATABASE:_EventOnDeadOrCrash( Event )
end
end
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnPlayerEnterUnit( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
if not self.PlayersAlive[Event.IniDCSUnitName] then
self:E( { "Add player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
self.PlayersAlive[Event.IniDCSUnitName] = Event.IniDCSUnit:getPlayerName()
self.ClientsAlive[Event.IniDCSUnitName] = self.CLIENTS[ Event.IniDCSUnitName ]
end
local PlayerName = Event.IniDCSUnit:getPlayerName()
if not self.PLAYERSALIVE[PlayerName] then
self:AddPlayer( Event.IniDCSUnitName, PlayerName )
end
end
end
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
-- @param #DATABASE self
-- @param Event#EVENTDATA Event
function DATABASE:_EventOnPlayerLeaveUnit( Event )
self:F( { Event } )
self:F2( { Event } )
if Event.IniDCSUnit then
if self:_IsIncludeDCSUnit( Event.IniDCSUnit ) then
if self.PlayersAlive[Event.IniDCSUnitName] then
self:E( { "Cleaning player for unit:", Event.IniDCSUnitName, Event.IniDCSUnit:getPlayerName() } )
self.PlayersAlive[Event.IniDCSUnitName] = nil
self.ClientsAlive[Event.IniDCSUnitName] = nil
end
local PlayerName = Event.IniDCSUnit:getPlayerName()
if self.PLAYERSALIVE[PlayerName] then
self:DeletePlayer( PlayerName )
end
end
end
--- Iterators
--- Interate the DATABASE and call an interator function for the given set, providing the Object for each element within the set and optional parameters.
--- Iterate the DATABASE and call an iterator function for the given set, providing the Object for each element within the set and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database.
-- @return #DATABASE self
function DATABASE:ForEach( IteratorFunction, arg, Set )
self:F( arg )
self:F2( arg )
local function CoRoutine()
local Count = 0
@ -7746,7 +7742,7 @@ function DATABASE:ForEach( IteratorFunction, arg, Set )
local function Schedule()
local status, res = coroutine.resume( co )
self:T( { status, res } )
self:T2( { status, res } )
if status == false then
error( res )
@ -7764,46 +7760,96 @@ function DATABASE:ForEach( IteratorFunction, arg, Set )
end
--- Interate the DATABASE and call an interator function for each **alive** unit, providing the Unit and optional parameters.
--- Iterate the DATABASE and call an iterator function for each **alive** unit, providing the DCSUnit and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive unit in the database. The function needs to accept a UNIT parameter.
-- @param #function IteratorFunction The function that will be called when there is an alive unit in the database. The function needs to accept a DCSUnit parameter.
-- @return #DATABASE self
function DATABASE:ForEachDCSUnit( IteratorFunction, ... )
self:F( arg )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.DCSUnits )
return self
end
--- Interate the DATABASE and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
--- Iterate the DATABASE and call an iterator function for each **alive** UNIT, providing the UNIT and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a UNIT parameter.
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the database. The function needs to accept a UNIT parameter.
-- @return #DATABASE self
function DATABASE:ForEachUnit( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.UNITS )
return self
end
--- Iterate the DATABASE and call an iterator function for each **alive** GROUP, providing the GROUP and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the database. The function needs to accept a GROUP parameter.
-- @return #DATABASE self
function DATABASE:ForEachGroup( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.GROUPS )
return self
end
--- Iterate the DATABASE and call an iterator function for each player, providing the player name and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an player in the database. The function needs to accept the player name.
-- @return #DATABASE self
function DATABASE:ForEachPlayer( IteratorFunction, ... )
self:F( arg )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.PlayersAlive )
self:ForEach( IteratorFunction, arg, self.PLAYERS )
return self
end
--- Interate the DATABASE and call an interator function for each client, providing the Client to the function and optional parameters.
--- Iterate the DATABASE and call an iterator function for each **alive** player, providing the Unit of the player and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a UNIT parameter.
-- @return #DATABASE self
function DATABASE:ForEachPlayerAlive( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.PLAYERSALIVE )
return self
end
--- Iterate the DATABASE and call an iterator function for each CLIENT, providing the CLIENT to the function and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a CLIENT parameter.
-- @return #DATABASE self
function DATABASE:ForEachClient( IteratorFunction, ... )
self:F( arg )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.CLIENTS )
return self
end
--- Iterate the DATABASE and call an iterator function for each **ALIVE** CLIENT, providing the CLIENT to the function and optional parameters.
-- @param #DATABASE self
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the database. The function needs to accept a CLIENT parameter.
-- @return #DATABASE self
function DATABASE:ForEachClientAlive( IteratorFunction, ... )
self:F2( arg )
self:ForEach( IteratorFunction, arg, self.CLIENTSALIVE )
function DATABASE:ScanEnvironment()
self:F()
return self
end
function DATABASE:_RegisterTemplates()
self:F2()
self.Navpoints = {}
self.UNITS = {}
@ -7853,7 +7899,7 @@ function DATABASE:ScanEnvironment()
for group_num, GroupTemplate in pairs(obj_type_data.group) do
if GroupTemplate and GroupTemplate.units and type(GroupTemplate.units) == 'table' then --making sure again- this is a valid group
self:_RegisterGroup( GroupTemplate )
self:_RegisterTemplate( GroupTemplate )
end --if GroupTemplate and GroupTemplate.units then
end --for group_num, GroupTemplate in pairs(obj_type_data.group) do
end --if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
@ -7865,121 +7911,10 @@ function DATABASE:ScanEnvironment()
end --if coa_name == 'red' or coa_name == 'blue' and type(coa_data) == 'table' then
end --for coa_name, coa_data in pairs(mission.coalition) do
self:_RegisterDatabase()
self:_RegisterPlayers()
return self
end
---
-- @param #DATABASE self
-- @param DCSUnit#Unit DCSUnit
-- @return #DATABASE self
function DATABASE:_IsIncludeDCSUnit( DCSUnit )
self:F( DCSUnit )
local DCSUnitInclude = true
if self.Filter.Coalitions then
local DCSUnitCoalition = false
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
self:T( { "Coalition:", DCSUnit:getCoalition(), self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == DCSUnit:getCoalition() then
DCSUnitCoalition = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCoalition
end
if self.Filter.Categories then
local DCSUnitCategory = false
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
self:T( { "Category:", DCSUnit:getDesc().category, self.FilterMeta.Categories[CategoryName], CategoryName } )
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == DCSUnit:getDesc().category then
DCSUnitCategory = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCategory
end
if self.Filter.Types then
local DCSUnitType = false
for TypeID, TypeName in pairs( self.Filter.Types ) do
self:T( { "Type:", DCSUnit:getTypeName(), TypeName } )
if TypeName == DCSUnit:getTypeName() then
DCSUnitType = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitType
end
if self.Filter.Countries then
local DCSUnitCountry = false
for CountryID, CountryName in pairs( self.Filter.Countries ) do
self:T( { "Country:", DCSUnit:getCountry(), CountryName } )
if country.id[CountryName] == DCSUnit:getCountry() then
DCSUnitCountry = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitCountry
end
if self.Filter.UnitPrefixes then
local DCSUnitPrefix = false
for UnitPrefixId, UnitPrefix in pairs( self.Filter.UnitPrefixes ) do
self:T( { "Unit Prefix:", string.find( DCSUnit:getName(), UnitPrefix, 1 ), UnitPrefix } )
if string.find( DCSUnit:getName(), UnitPrefix, 1 ) then
DCSUnitPrefix = true
end
end
DCSUnitInclude = DCSUnitInclude and DCSUnitPrefix
end
self:T( DCSUnitInclude )
return DCSUnitInclude
end
---
-- @param #DATABASE self
-- @param DCSUnit#Unit DCSUnit
-- @return #DATABASE self
function DATABASE:_IsAliveDCSUnit( DCSUnit )
self:F( DCSUnit )
local DCSUnitAlive = false
if DCSUnit and DCSUnit:isExist() and DCSUnit:isActive() then
if self.DCSUnits[DCSUnit:getName()] then
DCSUnitAlive = true
end
end
self:T( DCSUnitAlive )
return DCSUnitAlive
end
---
-- @param #DATABASE self
-- @param DCSGroup#Group DCSGroup
-- @return #DATABASE self
function DATABASE:_IsAliveDCSGroup( DCSGroup )
self:F( DCSGroup )
local DCSGroupAlive = false
if DCSGroup and DCSGroup:isExist() then
if self.DCSGroups[DCSGroup:getName()] then
DCSGroupAlive = true
end
end
self:T( DCSGroupAlive )
return DCSGroupAlive
end
--- Traces the current database contents in the log ... (for debug reasons).
-- @param #DATABASE self
-- @return #DATABASE self
function DATABASE:TraceDatabase()
self:F()
self:T( { "DCSUnits:", self.DCSUnits } )
end
--- The main include file for the MOOSE system.
@ -7995,7 +7930,7 @@ Include.File( "Event" )
_EVENTDISPATCHER = EVENT:New() -- #EVENT
--- Declare the main database object, which is used internally by the MOOSE classes.
_DATABASE = DATABASE:New():ScanEnvironment() -- Database#DATABASE
_DATABASE = DATABASE:New() -- Database#DATABASE
--- Scoring system for MOOSE.
-- This scoring class calculates the hits and kills that players make within a simulation session.

View File

@ -1,39 +1,52 @@
Include.File( 'Database' )
Include.File( 'UnitSet' )
Include.File( 'GroupSet' )
Include.File( 'Spawn' )
DBBluePlanes = DATABASE:New()
DBBluePlanes = UNITSET:New()
:FilterCoalitions( "blue" )
:FilterCategories( "plane" )
:FilterStart()
DBRedVehicles = DATABASE:New()
DBRedVehicles = UNITSET:New()
:FilterCoalitions( "red" )
:FilterCategories( "ground" )
:FilterStart()
DBShips = DATABASE:New()
DBShips = UNITSET:New()
:FilterCategories( "ship" )
:FilterStart()
DBBelgium = DATABASE:New()
DBBelgium = UNITSET:New()
:FilterCategories( "helicopter" )
:FilterCountries( "BELGIUM" )
:FilterStart()
DBNorthKorea = DATABASE:New()
DBNorthKorea = UNITSET:New()
:FilterCountries( "NORTH_KOREA" )
:FilterStart()
DBKA50Vinson = DATABASE:New()
DBKA50Vinson = UNITSET:New()
:FilterTypes( { "Ka-50", "VINSON" } )
:FilterStart()
DBBluePlanesGroup = GROUPSET:New()
:FilterCoalitions( "blue" )
:FilterCategories( "plane" )
:FilterStart()
DBNorthKoreaGroup = GROUPSET:New()
:FilterCountries( "NORTH_KOREA" )
:FilterStart()
DBBluePlanes:TraceDatabase()
DBRedVehicles:TraceDatabase()
DBShips:TraceDatabase()
DBBelgium:TraceDatabase()
DBNorthKorea:TraceDatabase()
DBKA50Vinson:TraceDatabase()
DBBluePlanes:Flush()
DBRedVehicles:Flush()
DBShips:Flush()
DBBelgium:Flush()
DBNorthKorea:Flush()
DBKA50Vinson:Flush()
DBBluePlanesGroup:Flush()
DBNorthKoreaGroup:Flush()
SpawnUS_Plane = SPAWN:New( 'Database Spawn Test USA Plane')
@ -54,21 +67,42 @@ GroupRU_Ship = SpawnRU_Ship:Spawn()
SpawnUS_AttackVehicle = SPAWN:New( 'Database Spawn Test USA Attack Vehicle' )
SpawnRU_AttackVehicle = SPAWN:New( 'Database Spawn Test RUSSIA Attack Vehicle' )
for i = 1, 10 do
for i = 1, 2 do
GroupRU_AttackVehicle = SpawnRU_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone RU"), true)
GroupUS_AttackVehicle = SpawnUS_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone US"), true)
end
--DBBlue:TraceDatabase()
routines.scheduleFunction( DBBluePlanes.TraceDatabase, { DBBluePlanes }, 1 )
routines.scheduleFunction( DBRedVehicles.TraceDatabase, { DBRedVehicles }, 1 )
routines.scheduleFunction( DBShips.TraceDatabase, { DBShips }, 1 )
routines.scheduleFunction( DBBelgium.TraceDatabase, { DBBelgium }, 1 )
routines.scheduleFunction( DBNorthKorea.TraceDatabase, { DBNorthKorea }, 1 )
routines.scheduleFunction( DBKA50Vinson.TraceDatabase, { DBKA50Vinson }, 1 )
SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
DBRedVehicles
:ForEachAliveUnit( function( DCSUnit )
DBRedVehicles:T( DCSUnit:getName() )
:ForEachUnit( function( MooseUnit )
DBRedVehicles:T( MooseUnit:GetName() )
end )
local function FlushPlayers()
_DATABASE:E( "FlushPlayers" )
_DATABASE
:ForEachPlayerAlive( function( Player )
_DATABASE:E( Player )
MESSAGE:New( Player, "Test", 5, "Player Test" ):ToAll()
return true
end )
return true
end
_DATABASE:E( "Schedule" )
local PlayerShow = SCHEDULER:New( nil, FlushPlayers, {}, 1, 10 )

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -253,7 +255,7 @@ These tracing levels were defined to avoid bulks of tracing to be generated by l
<tr>
<td class="name" nowrap="nowrap"><a href="##(BASE).New">BASE:New()</a></td>
<td class="summary">
<p>The base constructor.</p>
</td>
</tr>
<tr>
@ -769,7 +771,29 @@ is the Child class from which the Parent class needs to be retrieved.</p>
</dt>
<dd>
<p>The base constructor.</p>
<p>This is the top top class of all classed defined within the MOOSE.
Any new class needs to be derived from this class for proper inheritance.</p>
<h3>Return value</h3>
<p><em><a href="##(BASE)">#BASE</a>:</em>
The new instance of the BASE class.</p>
<h3>Usage:</h3>
<pre class="example"><code>function TASK:New()
local self = BASE:Inherit( self, BASE:New() )
-- assign Task default values during construction
self.TaskBriefing = "Task: No Task."
self.Time = timer.getTime()
self.ExecuteStage = _TransportExecuteStage.NONE
return self
end</code></pre>
</dd>
</dl>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -309,13 +311,19 @@ If the DCS Unit object does not exist or is nil, the CLIENT methods will return
<tr>
<td class="name" nowrap="nowrap"><a href="##(CLIENT).ShowBriefing">CLIENT:ShowBriefing()</a></td>
<td class="summary">
<p>Show the briefing of the MISSION to the CLIENT.</p>
<p>Show the briefing of a CLIENT.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CLIENT).ShowCargo">CLIENT:ShowCargo()</a></td>
<td class="summary">
<p>Shows the <a href="Cargo.html##(CARGO)">Cargo#CARGO</a> contained within the CLIENT to the player as a message.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CLIENT).ShowMissionBriefing">CLIENT:ShowMissionBriefing(MissionBriefing)</a></td>
<td class="summary">
<p>Show the mission briefing of a MISSION to the CLIENT.</p>
</td>
</tr>
<tr>
@ -992,7 +1000,7 @@ Name of the Group as defined within the Mission Editor. The Group must have a Un
</dt>
<dd>
<p>Show the briefing of the MISSION to the CLIENT.</p>
<p>Show the briefing of a CLIENT.</p>
<h3>Return value</h3>
@ -1020,6 +1028,32 @@ self</p>
<dl class="function">
<dt>
<a id="#(CLIENT).ShowMissionBriefing" >
<strong>CLIENT:ShowMissionBriefing(MissionBriefing)</strong>
</a>
</dt>
<dd>
<p>Show the mission briefing of a MISSION to the CLIENT.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string MissionBriefing </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(CLIENT)">#CLIENT</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CLIENT).SwitchMessages" >
<strong>CLIENT.SwitchMessages(PrmTable)</strong>
</a>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -68,80 +70,42 @@
<div id="content">
<h1>Module <code>Database</code></h1>
<p>Manage sets of units and groups.</p>
<p>Manage the mission database.</p>
<h1><a href="##(Database)">#Database</a> class</h1>
<p>Mission designers can use the DATABASE class to build sets of units belonging to certain:</p>
<h1><a href="##(DATABASE)">#DATABASE</a> class</h1>
<p>Mission designers can use the DATABASE class to refer to:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Unit types</li>
<li>Starting with certain prefix strings.</li>
<li>UNITS</li>
<li>GROUPS</li>
<li>players</li>
<li>alive players</li>
<li>CLIENTS</li>
<li>alive CLIENTS</li>
</ul>
<p>This list will grow over time. Planned developments are to include filters and iterators.
Additional filters will be added around <a href="Zone.html##(ZONEs)">Zone#ZONEs</a>, Radiuses, Active players, ...
More iterators will be implemented in the near future ...</p>
<p>Administers the Initial Sets of the Mission Templates as defined within the Mission Editor.</p>
<h1>DATABASE construction methods:</h1>
<p>Create a new DATABASE object with the <a href="##(DATABASE).New">DATABASE.New</a> method:</p>
<ul>
<li><a href="##(DATABASE).New">DATABASE.New</a>: Creates a new DATABASE object.</li>
</ul>
<h1>DATABASE filter criteria: </h1>
<p>You can set filter criteria to define the set of units within the database.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(DATABASE).FilterCoalitions">DATABASE.FilterCoalitions</a>: Builds the DATABASE with the units belonging to the coalition(s).</li>
<li><a href="##(DATABASE).FilterCategories">DATABASE.FilterCategories</a>: Builds the DATABASE with the units belonging to the category(ies).</li>
<li><a href="##(DATABASE).FilterTypes">DATABASE.FilterTypes</a>: Builds the DATABASE with the units belonging to the unit type(s).</li>
<li><a href="##(DATABASE).FilterCountries">DATABASE.FilterCountries</a>: Builds the DATABASE with the units belonging to the country(ies).</li>
<li><a href="##(DATABASE).FilterUnitPrefixes">DATABASE.FilterUnitPrefixes</a>: Builds the DATABASE with the units starting with the same prefix string(s).</li>
</ul>
<p>Once the filter criteria have been set for the DATABASE, you can start filtering using:</p>
<ul>
<li><a href="##(DATABASE).FilterStart">DATABASE.FilterStart</a>: Starts the filtering of the units within the database.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(DATABASE).FilterGroupPrefixes">DATABASE.FilterGroupPrefixes</a>: Builds the DATABASE with the groups of the units starting with the same prefix string(s).</li>
<li><a href="##(DATABASE).FilterZones">DATABASE.FilterZones</a>: Builds the DATABASE with the units within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<p>On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Gruop templates as defined within the Mission Editor.</p>
<p>Moose will automatically create one instance of the DATABASE class into the <strong>global</strong> object _DATABASE.
Moose refers to _DATABASE within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.</p>
<h1>DATABASE iterators:</h1>
<p>Once the filters have been defined and the DATABASE has been built, you can iterate the database with the available iterator methods.
<p>You can iterate the database with the available iterator methods.
The iterator methods will walk the DATABASE set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the DATABASE:</p>
<ul>
<li><a href="##(DATABASE).ForEachAliveUnit">DATABASE.ForEachAliveUnit</a>: Calls a function for each alive unit it finds within the DATABASE.</li>
<li><a href="##(DATABASE).ForEachUnit">DATABASE.ForEachUnit</a>: Calls a function for each <a href="UNIT.html">UNIT</a> it finds within the DATABASE.</li>
<li><a href="##(DATABASE).ForEachGroup">DATABASE.ForEachGroup</a>: Calls a function for each <a href="GROUP.html">GROUP</a> it finds within the DATABASE.</li>
<li><a href="##(DATABASE).ForEachPlayer">DATABASE.ForEachPlayer</a>: Calls a function for each player it finds within the DATABASE.</li>
<li><a href="##(DATABASE).ForEachPlayerAlive">DATABASE.ForEachPlayerAlive</a>: Calls a function for each alive player it finds within the DATABASE.</li>
<li><a href="##(DATABASE).ForEachClient">DATABASE.ForEachClient</a>: Calls a function for each <a href="CLIENT.html">CLIENT</a> it finds within the DATABASE.</li>
<li><a href="##(DATABASE).ForEachClientAlive">DATABASE.ForEachClientAlive</a>: Calls a function for each alive <a href="CLIENT.html">CLIENT</a> it finds within the DATABASE.
</li>
</ul>
<p>Planned iterators methods in development are (so these are not yet available):</p>
<ul>
<li><a href="##(DATABASE).ForEachUnit">DATABASE.ForEachUnit</a>: Calls a function for each unit contained within the DATABASE.</li>
<li><a href="##(DATABASE).ForEachGroup">DATABASE.ForEachGroup</a>: Calls a function for each group contained within the DATABASE.</li>
<li><a href="##(DATABASE).ForEachUnitInZone">DATABASE.ForEachUnitInZone</a>: Calls a function for each unit within a certain zone contained within the DATABASE.</li>
</ul>
<hr/>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
@ -163,6 +127,12 @@ The following iterator methods are currently available within the DATABASE:</p>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).AddGroup">DATABASE:AddGroup(DCSGroup, GroupName)</a></td>
<td class="summary">
<p>Adds a GROUP based on the GroupName in the DATABASE.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).AddPlayer">DATABASE:AddPlayer(UnitName, PlayerName)</a></td>
<td class="summary">
<p>Adds a player based on the Player Name in the DATABASE.</p>
</td>
</tr>
<tr>
@ -178,13 +148,13 @@ The following iterator methods are currently available within the DATABASE:</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ClassName">DATABASE.ClassName</a></td>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).CLIENTSALIVE">DATABASE.CLIENTSALIVE</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ClientsAlive">DATABASE.ClientsAlive</a></td>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ClassName">DATABASE.ClassName</a></td>
<td class="summary">
</td>
@ -199,24 +169,18 @@ The following iterator methods are currently available within the DATABASE:</p>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).DCSUnits">DATABASE.DCSUnits</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).DeletePlayer">DATABASE:DeletePlayer(PlayerName)</a></td>
<td class="summary">
<p>Deletes a player from the DATABASE based on the Player Name.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).DeleteUnit">DATABASE:DeleteUnit(DCSUnitName)</a></td>
<td class="summary">
<p>Deletes a Unit from the DATABASE based on the Unit Name.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).Filter">DATABASE.Filter</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).FilterMeta">DATABASE.FilterMeta</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -240,25 +204,49 @@ The following iterator methods are currently available within the DATABASE:</p>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEach">DATABASE:ForEach(IteratorFunction, arg, Set)</a></td>
<td class="summary">
<p>Interate the DATABASE and call an interator function for the given set, providing the Object for each element within the set and optional parameters.</p>
<p>Iterate the DATABASE and call an iterator function for the given set, providing the Object for each element within the set and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachClient">DATABASE:ForEachClient(IteratorFunction, ...)</a></td>
<td class="summary">
<p>Interate the DATABASE and call an interator function for each client, providing the Client to the function and optional parameters.</p>
<p>Iterate the DATABASE and call an iterator function for each CLIENT, providing the CLIENT to the function and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachClientAlive">DATABASE:ForEachClientAlive(IteratorFunction, ...)</a></td>
<td class="summary">
<p>Iterate the DATABASE and call an iterator function for each <strong>ALIVE</strong> CLIENT, providing the CLIENT to the function and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachDCSUnit">DATABASE:ForEachDCSUnit(IteratorFunction, ...)</a></td>
<td class="summary">
<p>Interate the DATABASE and call an interator function for each <strong>alive</strong> unit, providing the Unit and optional parameters.</p>
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> unit, providing the DCSUnit and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachGroup">DATABASE:ForEachGroup(IteratorFunction, ...)</a></td>
<td class="summary">
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> GROUP, providing the GROUP and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachPlayer">DATABASE:ForEachPlayer(IteratorFunction, ...)</a></td>
<td class="summary">
<p>Interate the DATABASE and call an interator function for each <strong>alive</strong> player, providing the Unit of the player and optional parameters.</p>
<p>Iterate the DATABASE and call an iterator function for each player, providing the player name and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachPlayerAlive">DATABASE:ForEachPlayerAlive(IteratorFunction, ...)</a></td>
<td class="summary">
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> player, providing the Unit of the player and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachUnit">DATABASE:ForEachUnit(IteratorFunction, ...)</a></td>
<td class="summary">
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> UNIT, providing the UNIT and optional parameters.</p>
</td>
</tr>
<tr>
@ -286,19 +274,13 @@ The following iterator methods are currently available within the DATABASE:</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).Players">DATABASE.Players</a></td>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).PLAYERS">DATABASE.PLAYERS</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).PlayersAlive">DATABASE.PlayersAlive</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ScanEnvironment">DATABASE:ScanEnvironment()</a></td>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).PLAYERSALIVE">DATABASE.PLAYERSALIVE</a></td>
<td class="summary">
</td>
@ -313,24 +295,12 @@ The following iterator methods are currently available within the DATABASE:</p>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).Spawn">DATABASE:Spawn(SpawnTemplate)</a></td>
<td class="summary">
<p>Instantiate new Groups within the DCSRTE.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).Statics">DATABASE.Statics</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).Templates">DATABASE.Templates</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE).TraceDatabase">DATABASE:TraceDatabase()</a></td>
<td class="summary">
<p>Traces the current database contents in the log ...</p>
</td>
</tr>
<tr>
@ -361,24 +331,6 @@ The following iterator methods are currently available within the DATABASE:</p>
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._EventOnPlayerLeaveUnit">DATABASE:_EventOnPlayerLeaveUnit(Event)</a></td>
<td class="summary">
<p>Handles the OnPlayerLeaveUnit event to clean the active players table.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._IsAliveDCSGroup">DATABASE:_IsAliveDCSGroup(DCSGroup)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._IsAliveDCSUnit">DATABASE:_IsAliveDCSUnit(DCSUnit)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._IsIncludeDCSUnit">DATABASE:_IsIncludeDCSUnit(DCSUnit)</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -388,15 +340,21 @@ The following iterator methods are currently available within the DATABASE:</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._RegisterGroup">DATABASE:_RegisterGroup(GroupTemplate)</a></td>
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._RegisterPlayers">DATABASE:_RegisterPlayers()</a></td>
<td class="summary">
<p>Private method that registers all alive players in the mission.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._RegisterTemplate">DATABASE:_RegisterTemplate(GroupTemplate)</a></td>
<td class="summary">
<p>Private method that registers new Group Templates within the DATABASE Object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._RegisterPlayers">DATABASE:_RegisterPlayers()</a></td>
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._RegisterTemplates">DATABASE:_RegisterTemplates()</a></td>
<td class="summary">
<p>Private method that registers all alive players in the mission.</p>
</td>
</tr>
</table>
@ -473,6 +431,32 @@ The following iterator methods are currently available within the DATABASE:</p>
<dl class="function">
<dt>
<a id="#(DATABASE).AddPlayer" >
<strong>DATABASE:AddPlayer(UnitName, PlayerName)</strong>
</a>
</dt>
<dd>
<p>Adds a player based on the Player Name in the DATABASE.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> UnitName </em></code>: </p>
</li>
<li>
<p><code><em> PlayerName </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE).AddUnit" >
<strong>DATABASE:AddUnit(DCSUnit, DCSUnitName)</strong>
</a>
@ -513,9 +497,9 @@ The following iterator methods are currently available within the DATABASE:</p>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(DATABASE).ClassName" >
<strong>DATABASE.ClassName</strong>
<em></em>
<a id="#(DATABASE).CLIENTSALIVE" >
<strong>DATABASE.CLIENTSALIVE</strong>
</a>
</dt>
<dd>
@ -527,9 +511,9 @@ The following iterator methods are currently available within the DATABASE:</p>
<dl class="function">
<dt>
<em></em>
<a id="#(DATABASE).ClientsAlive" >
<strong>DATABASE.ClientsAlive</strong>
<em>#string</em>
<a id="#(DATABASE).ClassName" >
<strong>DATABASE.ClassName</strong>
</a>
</dt>
<dd>
@ -564,6 +548,27 @@ The following iterator methods are currently available within the DATABASE:</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE).DeletePlayer" >
<strong>DATABASE:DeletePlayer(PlayerName)</strong>
</a>
</dt>
<dd>
<p>Deletes a player from the DATABASE based on the Player Name.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> PlayerName </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
@ -585,34 +590,6 @@ The following iterator methods are currently available within the DATABASE:</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(DATABASE).Filter" >
<strong>DATABASE.Filter</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(DATABASE).FilterMeta" >
<strong>DATABASE.FilterMeta</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -702,7 +679,7 @@ The found Unit.</p>
</dt>
<dd>
<p>Interate the DATABASE and call an interator function for the given set, providing the Object for each element within the set and optional parameters.</p>
<p>Iterate the DATABASE and call an iterator function for the given set, providing the Object for each element within the set and optional parameters.</p>
<h3>Parameters</h3>
<ul>
@ -739,7 +716,7 @@ self</p>
</dt>
<dd>
<p>Interate the DATABASE and call an interator function for each client, providing the Client to the function and optional parameters.</p>
<p>Iterate the DATABASE and call an iterator function for each CLIENT, providing the CLIENT to the function and optional parameters.</p>
<h3>Parameters</h3>
<ul>
@ -765,20 +742,84 @@ self</p>
<dl class="function">
<dt>
<a id="#(DATABASE).ForEachDCSUnit" >
<strong>DATABASE:ForEachDCSUnit(IteratorFunction, ...)</strong>
<a id="#(DATABASE).ForEachClientAlive" >
<strong>DATABASE:ForEachClientAlive(IteratorFunction, ...)</strong>
</a>
</dt>
<dd>
<p>Interate the DATABASE and call an interator function for each <strong>alive</strong> unit, providing the Unit and optional parameters.</p>
<p>Iterate the DATABASE and call an iterator function for each <strong>ALIVE</strong> CLIENT, providing the CLIENT to the function and optional parameters.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#function IteratorFunction </em></code>:
The function that will be called when there is an alive unit in the database. The function needs to accept a UNIT parameter.</p>
The function that will be called when there is an alive CLIENT in the database. The function needs to accept a CLIENT parameter.</p>
</li>
<li>
<p><code><em> ... </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE).ForEachDCSUnit" >
<strong>DATABASE:ForEachDCSUnit(IteratorFunction, ...)</strong>
</a>
</dt>
<dd>
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> unit, providing the DCSUnit and optional parameters.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#function IteratorFunction </em></code>:
The function that will be called when there is an alive unit in the database. The function needs to accept a DCSUnit parameter.</p>
</li>
<li>
<p><code><em> ... </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE).ForEachGroup" >
<strong>DATABASE:ForEachGroup(IteratorFunction, ...)</strong>
</a>
</dt>
<dd>
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> GROUP, providing the GROUP and optional parameters.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#function IteratorFunction </em></code>:
The function that will be called when there is an alive GROUP in the database. The function needs to accept a GROUP parameter.</p>
</li>
<li>
@ -803,7 +844,39 @@ self</p>
</dt>
<dd>
<p>Interate the DATABASE and call an interator function for each <strong>alive</strong> player, providing the Unit of the player and optional parameters.</p>
<p>Iterate the DATABASE and call an iterator function for each player, providing the player name and optional parameters.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#function IteratorFunction </em></code>:
The function that will be called when there is an player in the database. The function needs to accept the player name.</p>
</li>
<li>
<p><code><em> ... </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE).ForEachPlayerAlive" >
<strong>DATABASE:ForEachPlayerAlive(IteratorFunction, ...)</strong>
</a>
</dt>
<dd>
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> player, providing the Unit of the player and optional parameters.</p>
<h3>Parameters</h3>
<ul>
@ -824,6 +897,38 @@ The function that will be called when there is an alive player in the database.
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE).ForEachUnit" >
<strong>DATABASE:ForEachUnit(IteratorFunction, ...)</strong>
</a>
</dt>
<dd>
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> UNIT, providing the UNIT and optional parameters.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#function IteratorFunction </em></code>:
The function that will be called when there is an alive UNIT in the database. The function needs to accept a UNIT parameter.</p>
</li>
<li>
<p><code><em> ... </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
@ -901,8 +1006,8 @@ DBObject = DATABASE:New()</code></pre>
<dt>
<em></em>
<a id="#(DATABASE).Players" >
<strong>DATABASE.Players</strong>
<a id="#(DATABASE).PLAYERS" >
<strong>DATABASE.PLAYERS</strong>
</a>
</dt>
<dd>
@ -915,21 +1020,8 @@ DBObject = DATABASE:New()</code></pre>
<dt>
<em></em>
<a id="#(DATABASE).PlayersAlive" >
<strong>DATABASE.PlayersAlive</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE).ScanEnvironment" >
<strong>DATABASE:ScanEnvironment()</strong>
<a id="#(DATABASE).PLAYERSALIVE" >
<strong>DATABASE.PLAYERSALIVE</strong>
</a>
</dt>
<dd>
@ -993,20 +1085,6 @@ This method is used by the SPAWN class.</p>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(DATABASE).Statics" >
<strong>DATABASE.Statics</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -1021,27 +1099,6 @@ self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE).TraceDatabase" >
<strong>DATABASE:TraceDatabase()</strong>
</a>
</dt>
<dd>
<p>Traces the current database contents in the log ...</p>
<p>(for debug reasons).</p>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
@ -1145,84 +1202,6 @@ self</p>
<dl class="function">
<dt>
<a id="#(DATABASE)._IsAliveDCSGroup" >
<strong>DATABASE:_IsAliveDCSGroup(DCSGroup)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="DCSGroup.html##(Group)">DCSGroup#Group</a> DCSGroup </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE)._IsAliveDCSUnit" >
<strong>DATABASE:_IsAliveDCSUnit(DCSUnit)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="DCSUnit.html##(Unit)">DCSUnit#Unit</a> DCSUnit </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE)._IsIncludeDCSUnit" >
<strong>DATABASE:_IsIncludeDCSUnit(DCSUnit)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="DCSUnit.html##(Unit)">DCSUnit#Unit</a> DCSUnit </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE)._RegisterDatabase" >
<strong>DATABASE:_RegisterDatabase()</strong>
</a>
@ -1241,32 +1220,6 @@ self</p>
<dl class="function">
<dt>
<a id="#(DATABASE)._RegisterGroup" >
<strong>DATABASE:_RegisterGroup(GroupTemplate)</strong>
</a>
</dt>
<dd>
<p>Private method that registers new Group Templates within the DATABASE Object.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#table GroupTemplate </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE)._RegisterPlayers" >
<strong>DATABASE:_RegisterPlayers()</strong>
</a>
@ -1280,6 +1233,45 @@ self</p>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE)._RegisterTemplate" >
<strong>DATABASE:_RegisterTemplate(GroupTemplate)</strong>
</a>
</dt>
<dd>
<p>Private method that registers new Group Templates within the DATABASE Object.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#table GroupTemplate </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DATABASE)._RegisterTemplates" >
<strong>DATABASE:_RegisterTemplates()</strong>
</a>
</dt>
<dd>
</dd>
</dl>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -1859,6 +1861,9 @@ self</p>
<p>self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, Seconds )</p>
</dd>
</dl>
<dl class="function">

View File

@ -42,11 +42,12 @@
<li>Event</li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li>GOHOMETASK</li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li>Group</li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -212,6 +214,12 @@ If the DCS Group object does not exist or is nil, the GROUP methods will return
<td class="name" nowrap="nowrap"><a href="##(GROUP).GetCoalition">GROUP:GetCoalition()</a></td>
<td class="summary">
<p>Returns the coalition of the DCS Group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUP).GetCountry">GROUP:GetCountry()</a></td>
<td class="summary">
<p>Returns the country of the DCS Group.</p>
</td>
</tr>
<tr>
@ -1068,6 +1076,34 @@ The coalition side of the DCS Group.</p>
<dl class="function">
<dt>
<a id="#(GROUP).GetCountry" >
<strong>GROUP:GetCountry()</strong>
</a>
</dt>
<dd>
<p>Returns the country of the DCS Group.</p>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="DCScountry.html##(country.id)">DCScountry#country.id</a>:</em>
The country identifier.</p>
</li>
<li>
<p><em>#nil:</em>
The DCS Group is not existing or alive. </p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUP).GetDCSGroup" >
<strong>GROUP:GetDCSGroup()</strong>
</a>

View File

@ -0,0 +1,644 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div>
<div id="main">
<div id="navigation">
<h2>Modules</h2>
<ul><li>
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="Base.html">Base</a></li>
<li><a href="CARGO.html">CARGO</a></li>
<li><a href="CleanUp.html">CleanUp</a></li>
<li><a href="Client.html">Client</a></li>
<li><a href="DCSAirbase.html">DCSAirbase</a></li>
<li><a href="DCSCoalitionObject.html">DCSCoalitionObject</a></li>
<li><a href="DCSCommand.html">DCSCommand</a></li>
<li><a href="DCSController.html">DCSController</a></li>
<li><a href="DCSGroup.html">DCSGroup</a></li>
<li><a href="DCSObject.html">DCSObject</a></li>
<li><a href="DCSTask.html">DCSTask</a></li>
<li><a href="DCSTypes.html">DCSTypes</a></li>
<li><a href="DCSUnit.html">DCSUnit</a></li>
<li><a href="DCSWorld.html">DCSWorld</a></li>
<li><a href="DCStimer.html">DCStimer</a></li>
<li><a href="DEPLOYTASK.html">DEPLOYTASK</a></li>
<li><a href="DESTROYBASETASK.html">DESTROYBASETASK</a></li>
<li><a href="DESTROYGROUPSTASK.html">DESTROYGROUPSTASK</a></li>
<li><a href="DESTROYRADARSTASK.html">DESTROYRADARSTASK</a></li>
<li><a href="DESTROYUNITTYPESTASK.html">DESTROYUNITTYPESTASK</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li>GroupSet</li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
<li><a href="STAGE.html">STAGE</a></li>
<li><a href="Scheduler.html">Scheduler</a></li>
<li><a href="Scoring.html">Scoring</a></li>
<li><a href="Sead.html">Sead</a></li>
<li><a href="Set.html">Set</a></li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>GroupSet</code></h1>
<p>Create and manage a set of groups.</p>
<h1><a href="##(GROUPSET)">#GROUPSET</a> class</h1>
<p>Mission designers can use the GROUPSET class to build sets of groups belonging to certain:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Starting with certain prefix strings.</li>
</ul>
<h1>GROUPSET construction methods:</h1>
<p>Create a new GROUPSET object with the <a href="##(GROUPSET).New">GROUPSET.New</a> method:</p>
<ul>
<li><a href="##(GROUPSET).New">GROUPSET.New</a>: Creates a new GROUPSET object.</li>
</ul>
<h1>GROUPSET filter criteria: </h1>
<p>You can set filter criteria to define the set of groups within the GROUPSET.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(GROUPSET).FilterCoalitions">GROUPSET.FilterCoalitions</a>: Builds the GROUPSET with the groups belonging to the coalition(s).</li>
<li><a href="##(GROUPSET).FilterCategories">GROUPSET.FilterCategories</a>: Builds the GROUPSET with the groups belonging to the category(ies).</li>
<li><a href="##(GROUPSET).FilterTypes">GROUPSET.FilterTypes</a>: Builds the GROUPSET with the groups belonging to the unit type(s).</li>
<li><a href="##(GROUPSET).FilterPrefixes">GROUPSET.FilterPrefixes</a>: Builds the GROUPSET with the groups starting with the same prefix string(s).</li>
</ul>
<p>Once the filter criteria have been set for the GROUPSET, you can start filtering using:</p>
<ul>
<li><a href="##(GROUPSET).FilterStart">GROUPSET.FilterStart</a>: Starts the filtering of the groups within the GROUPSET.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(GROUPSET).FilterZones">GROUPSET.FilterZones</a>: Builds the GROUPSET with the groups within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<h1>GROUPSET iterators:</h1>
<p>Once the filters have been defined and the GROUPSET has been built, you can iterate the GROUPSET with the available iterator methods.
The iterator methods will walk the GROUPSET set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the GROUPSET:</p>
<ul>
<li><a href="##(GROUPSET).ForEachGroup">GROUPSET.ForEachGroup</a>: Calls a function for each alive unit it finds within the GROUPSET.</li>
</ul>
<p>Planned iterators methods in development are (so these are not yet available):</p>
<ul>
<li><a href="##(GROUPSET).ForEachUnitInGroup">GROUPSET.ForEachUnitInGroup</a>: Calls a function for each group contained within the GROUPSET.</li>
<li><a href="##(GROUPSET).ForEachUnitInZone">GROUPSET.ForEachUnitInZone</a>: Calls a function for each unit within a certain zone contained within the GROUPSET.</li>
</ul>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#GROUPSET">GROUPSET</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(GROUPSET)">Type <code>GROUPSET</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).AddInDatabase">GROUPSET:AddInDatabase(Event)</a></td>
<td class="summary">
<p>Handles the Database to check on an event (birth) that the Object was added in the Database.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).ClassName">GROUPSET.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).Filter">GROUPSET.Filter</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).FilterCategories">GROUPSET:FilterCategories(Categories)</a></td>
<td class="summary">
<p>Builds a set of groups out of categories.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).FilterCoalitions">GROUPSET:FilterCoalitions(Coalitions)</a></td>
<td class="summary">
<p>Builds a set of groups of coalitions.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).FilterCountries">GROUPSET:FilterCountries(Countries)</a></td>
<td class="summary">
<p>Builds a set of groups of defined countries.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).FilterMeta">GROUPSET.FilterMeta</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).FilterPrefixes">GROUPSET:FilterPrefixes(Prefixes)</a></td>
<td class="summary">
<p>Builds a set of groups of defined unit prefixes.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).FilterStart">GROUPSET:FilterStart()</a></td>
<td class="summary">
<p>Starts the filtering.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).FindInDatabase">GROUPSET:FindInDatabase(Event)</a></td>
<td class="summary">
<p>Handles the Database to check on any event that Object exists in the Database.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).FindUnit">GROUPSET:FindUnit(GroupName)</a></td>
<td class="summary">
<p>Finds a Unit based on the Unit Name.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).ForEachUnit">GROUPSET:ForEachUnit(IteratorFunction, ...)</a></td>
<td class="summary">
<p>Interate the GROUPSET and call an interator function for each <strong>alive</strong> GROUP, providing the GROUP and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).IsIncludeObject">GROUPSET:IsIncludeObject(MooseGroup)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).New">GROUPSET:New()</a></td>
<td class="summary">
<p>Creates a new GROUPSET object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUPSET).Units">GROUPSET.Units</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(GROUPSET)">#GROUPSET</a></em>
<a id="GROUPSET" >
<strong>GROUPSET</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(GroupSet)" >Type <code>GroupSet</code></a></h2>
<h2><a id="#(GROUPSET)" >Type <code>GROUPSET</code></a></h2>
<p>GROUPSET class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(GROUPSET).AddInDatabase" >
<strong>GROUPSET:AddInDatabase(Event)</strong>
</a>
</dt>
<dd>
<p>Handles the Database to check on an event (birth) that the Object was added in the Database.</p>
<p>This is required, because sometimes the _DATABASE birth event gets called later than the SET birth event!</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Event.html##(EVENTDATA)">Event#EVENTDATA</a> Event </em></code>: </p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em>#string:</em>
The name of the GROUP</p>
</li>
<li>
<p><em>#table:</em>
The GROUP</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(GROUPSET).ClassName" >
<strong>GROUPSET.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(GROUPSET).Filter" >
<strong>GROUPSET.Filter</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).FilterCategories" >
<strong>GROUPSET:FilterCategories(Categories)</strong>
</a>
</dt>
<dd>
<p>Builds a set of groups out of categories.</p>
<p>Possible current categories are plane, helicopter, ground, ship.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Categories </em></code>:
Can take the following values: "plane", "helicopter", "ground", "ship".</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(GROUPSET)">#GROUPSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).FilterCoalitions" >
<strong>GROUPSET:FilterCoalitions(Coalitions)</strong>
</a>
</dt>
<dd>
<p>Builds a set of groups of coalitions.</p>
<p>Possible current coalitions are red, blue and neutral.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Coalitions </em></code>:
Can take the following values: "red", "blue", "neutral".</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(GROUPSET)">#GROUPSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).FilterCountries" >
<strong>GROUPSET:FilterCountries(Countries)</strong>
</a>
</dt>
<dd>
<p>Builds a set of groups of defined countries.</p>
<p>Possible current countries are those known within DCS world.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Countries </em></code>:
Can take those country strings known within DCS world.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(GROUPSET)">#GROUPSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(GROUPSET).FilterMeta" >
<strong>GROUPSET.FilterMeta</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).FilterPrefixes" >
<strong>GROUPSET:FilterPrefixes(Prefixes)</strong>
</a>
</dt>
<dd>
<p>Builds a set of groups of defined unit prefixes.</p>
<p>All the groups starting with the given prefixes will be included within the set.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Prefixes </em></code>:
The prefix of which the group name starts with.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(GROUPSET)">#GROUPSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).FilterStart" >
<strong>GROUPSET:FilterStart()</strong>
</a>
</dt>
<dd>
<p>Starts the filtering.</p>
<h3>Return value</h3>
<p><em><a href="##(GROUPSET)">#GROUPSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).FindInDatabase" >
<strong>GROUPSET:FindInDatabase(Event)</strong>
</a>
</dt>
<dd>
<p>Handles the Database to check on any event that Object exists in the Database.</p>
<p>This is required, because sometimes the _DATABASE event gets called later than the SET event or vise versa!</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Event.html##(EVENTDATA)">Event#EVENTDATA</a> Event </em></code>: </p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em>#string:</em>
The name of the GROUP</p>
</li>
<li>
<p><em>#table:</em>
The GROUP</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).FindUnit" >
<strong>GROUPSET:FindUnit(GroupName)</strong>
</a>
</dt>
<dd>
<p>Finds a Unit based on the Unit Name.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string GroupName </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="Group.html##(GROUP)">Group#GROUP</a>:</em>
The found Unit.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).ForEachUnit" >
<strong>GROUPSET:ForEachUnit(IteratorFunction, ...)</strong>
</a>
</dt>
<dd>
<p>Interate the GROUPSET and call an interator function for each <strong>alive</strong> GROUP, providing the GROUP and optional parameters.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#function IteratorFunction </em></code>:
The function that will be called when there is an alive GROUP in the GROUPSET. The function needs to accept a GROUP parameter.</p>
</li>
<li>
<p><code><em> ... </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(GROUPSET)">#GROUPSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).IsIncludeObject" >
<strong>GROUPSET:IsIncludeObject(MooseGroup)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Group.html##(GROUP)">Group#GROUP</a> MooseGroup </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(GROUPSET)">#GROUPSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(GROUPSET).New" >
<strong>GROUPSET:New()</strong>
</a>
</dt>
<dd>
<p>Creates a new GROUPSET object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.</p>
<h3>Return value</h3>
<p><em><a href="##(GROUPSET)">#GROUPSET</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- Define a new GROUPSET Object. This DBObject will contain a reference to all alive GROUPS.
DBObject = GROUPSET:New()</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(GROUPSET).Units" >
<strong>GROUPSET.Units</strong>
</a>
</dt>
<dd>
</dd>
</dl>
</div>
</div>
</body>
</html>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li>MISSION</li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li>Mission</li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -66,7 +68,7 @@
</ul>
</div>
<div id="content">
<h1>Module <code>MISSION</code></h1>
<h1>Module <code>Mission</code></h1>
<p>A MISSION is the main owner of a Mission orchestration within MOOSE .</p>
@ -86,12 +88,6 @@ A <a href="CLIENT.html">CLIENT</a> needs to be registered within the <a href="MI
<td class="name" nowrap="nowrap"><a href="#MISSIONSCHEDULER">MISSIONSCHEDULER</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#TaskComplete">TaskComplete</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -101,8 +97,8 @@ A <a href="CLIENT.html">CLIENT</a> needs to be registered within the <a href="MI
</td>
</tr>
</table>
<h2><a id="#(MISSION)" >Type <code>MISSION</code></a></h2>
<table class="function_list">
<h2><a id="#(MISSION)">Type <code>MISSION</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(MISSION).AddClient">MISSION.AddClient(CLIENT, self, Client)</a></td>
<td class="summary">
@ -197,6 +193,12 @@ A <a href="CLIENT.html">CLIENT</a> needs to be registered within the <a href="MI
<td class="name" nowrap="nowrap"><a href="##(MISSION).Meta">MISSION:Meta()</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MISSION).MissionBriefing">MISSION.MissionBriefing</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -466,24 +468,6 @@ A <a href="CLIENT.html">CLIENT</a> needs to be registered within the <a href="MI
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="TaskComplete" >
<strong>TaskComplete</strong>
</a>
</dt>
<dd>
<p> For each Client, check for each Task the state and evolve the mission.
This flag will indicate if the Task of the Client is Complete.</p>
</dd>
</dl>
<dl class="function">
@ -511,8 +495,13 @@ A <a href="CLIENT.html">CLIENT</a> needs to be registered within the <a href="MI
</dd>
</dl>
<h2><a id="#(MISSION)" >Type <code>MISSION</code></a></h2>
<h3>Field(s)</h3>
<h2><a id="#(Mission)" >Type <code>Mission</code></a></h2>
<h2><a id="#(MISSION)" >Type <code>MISSION</code></a></h2>
<p>The MISSION class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
@ -550,10 +539,10 @@ Client is the <a href="CLIENT.html">CLIENT</a> object. The object must have been
<h3>Usage:</h3>
<pre class="example"><code>Add a number of Client objects to the Mission.
Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )</code></pre>
Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )</code></pre>
</dd>
</dl>
@ -885,6 +874,20 @@ env.info( "Task 2 Completion = " .. Tasks[2]:GetGoalPercentage() .. "%" )</code>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(MISSION).MissionBriefing" >
<strong>MISSION.MissionBriefing</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -1197,7 +1200,7 @@ local Mission = MISSIONSCHEDULER.AddMission( 'Rescue secret agent', 'Tactical',
<dl class="function">
<dt>
<em></em>
<em><a href="##(MISSION.Clients)">#MISSION.Clients</a></em>
<a id="#(MISSION)._Clients" >
<strong>MISSION._Clients</strong>
</a>
@ -1237,6 +1240,8 @@ local Mission = MISSIONSCHEDULER.AddMission( 'Rescue secret agent', 'Tactical',
</dd>
</dl>
<h2><a id="#(MISSION.Clients)" >Type <code>MISSION.Clients</code></a></h2>
<h2><a id="#(MISSIONSCHEDULER)" >Type <code>MISSIONSCHEDULER</code></a></h2>
<p>The MISSIONSCHEDULER is an OBJECT and is the main scheduler of ALL active MISSIONs registered within this scheduler.</p>
@ -1339,7 +1344,7 @@ MissionFind = MISSIONSCHEDULER:FindMission( 'Russia Transport Troops SA-6' )</co
<dl class="function">
<dt>
<em></em>
<em><a href="##(MISSIONSCHEDULER.MISSIONS)">#MISSIONSCHEDULER.MISSIONS</a></em>
<a id="#(MISSIONSCHEDULER).Missions" >
<strong>MISSIONSCHEDULER.Missions</strong>
</a>
@ -1491,6 +1496,9 @@ MISSIONSCHEDULER:RemoveMission( 'Russia Transport Troops SA-6' )</code></pre>
<p>MISSIONSCHEDULER.SchedulerId = routines.scheduleFunction( MISSIONSCHEDULER.Scheduler, { }, 0, 2 )</p>
</dd>
</dl>
<dl class="function">
@ -1628,6 +1636,8 @@ MISSIONSCHEDULER:RemoveMission( 'Russia Transport Troops SA-6' )</code></pre>
</dd>
</dl>
<h2><a id="#(MISSIONSCHEDULER.MISSIONS)" >Type <code>MISSIONSCHEDULER.MISSIONS</code></a></h2>
</div>
</div>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li>MOVEMENT</li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li>Menu</li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li>Message</li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li>MissileTrainer</li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li>NOTASK</li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li>PICKUPTASK</li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li>ROUTETASK</li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -274,6 +276,16 @@
<td class="name" nowrap="nowrap"><a href="##(STAGE).WaitTime">STAGE.WaitTime</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(STAGEBRIEF)">Type <code>STAGEBRIEF</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(STAGEBRIEF).StageBriefingTime">STAGEBRIEF.StageBriefingTime</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -809,6 +821,23 @@
<h2><a id="#(STAGEARRIVE)" >Type <code>STAGEARRIVE</code></a></h2>
<h2><a id="#(STAGEBRIEF)" >Type <code>STAGEBRIEF</code></a></h2>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em></em>
<a id="#(STAGEBRIEF).StageBriefingTime" >
<strong>STAGEBRIEF.StageBriefingTime</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(STAGELANDING)" >Type <code>STAGELANDING</code></a></h2>
<h2><a id="#(STAGEROUTE)" >Type <code>STAGEROUTE</code></a></h2>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -91,8 +93,6 @@
</ul>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
@ -120,12 +120,6 @@
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Repeat">SCHEDULER.Repeat</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Scheduler">SCHEDULER:Scheduler()</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -138,6 +132,12 @@
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Stop">SCHEDULER:Stop()</a></td>
<td class="summary">
<p>Stops the scheduler.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER)._Scheduler">SCHEDULER:_Scheduler()</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -253,19 +253,6 @@ self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULER).Scheduler" >
<strong>SCHEDULER:Scheduler()</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -302,6 +289,19 @@ self</p>
<p><em><a href="##(SCHEDULER)">#SCHEDULER</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULER)._Scheduler" >
<strong>SCHEDULER:_Scheduler()</strong>
</a>
</dt>
<dd>
</dd>
</dl>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

File diff suppressed because it is too large Load Diff

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li>StaticObject</li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li>TASK</li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li>Unit</li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -0,0 +1,682 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div>
<div id="main">
<div id="navigation">
<h2>Modules</h2>
<ul><li>
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="Base.html">Base</a></li>
<li><a href="CARGO.html">CARGO</a></li>
<li><a href="CleanUp.html">CleanUp</a></li>
<li><a href="Client.html">Client</a></li>
<li><a href="DCSAirbase.html">DCSAirbase</a></li>
<li><a href="DCSCoalitionObject.html">DCSCoalitionObject</a></li>
<li><a href="DCSCommand.html">DCSCommand</a></li>
<li><a href="DCSController.html">DCSController</a></li>
<li><a href="DCSGroup.html">DCSGroup</a></li>
<li><a href="DCSObject.html">DCSObject</a></li>
<li><a href="DCSTask.html">DCSTask</a></li>
<li><a href="DCSTypes.html">DCSTypes</a></li>
<li><a href="DCSUnit.html">DCSUnit</a></li>
<li><a href="DCSWorld.html">DCSWorld</a></li>
<li><a href="DCStimer.html">DCStimer</a></li>
<li><a href="DEPLOYTASK.html">DEPLOYTASK</a></li>
<li><a href="DESTROYBASETASK.html">DESTROYBASETASK</a></li>
<li><a href="DESTROYGROUPSTASK.html">DESTROYGROUPSTASK</a></li>
<li><a href="DESTROYRADARSTASK.html">DESTROYRADARSTASK</a></li>
<li><a href="DESTROYUNITTYPESTASK.html">DESTROYUNITTYPESTASK</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
<li><a href="STAGE.html">STAGE</a></li>
<li><a href="Scheduler.html">Scheduler</a></li>
<li><a href="Scoring.html">Scoring</a></li>
<li><a href="Sead.html">Sead</a></li>
<li><a href="Set.html">Set</a></li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li>UnitSet</li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>UnitSet</code></h1>
<p>Create and manage a set of units.</p>
<h1><a href="##(UNITSET)">#UNITSET</a> class</h1>
<p>Mission designers can use the UNITSET class to build sets of units belonging to certain:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Unit types</li>
<li>Starting with certain prefix strings.</li>
</ul>
<h1>UNITSET construction methods:</h1>
<p>Create a new UNITSET object with the <a href="##(UNITSET).New">UNITSET.New</a> method:</p>
<ul>
<li><a href="##(UNITSET).New">UNITSET.New</a>: Creates a new UNITSET object.</li>
</ul>
<h1>UNITSET filter criteria: </h1>
<p>You can set filter criteria to define the set of units within the UNITSET.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(UNITSET).FilterCoalitions">UNITSET.FilterCoalitions</a>: Builds the UNITSET with the units belonging to the coalition(s).</li>
<li><a href="##(UNITSET).FilterCategories">UNITSET.FilterCategories</a>: Builds the UNITSET with the units belonging to the category(ies).</li>
<li><a href="##(UNITSET).FilterTypes">UNITSET.FilterTypes</a>: Builds the UNITSET with the units belonging to the unit type(s).</li>
<li><a href="##(UNITSET).FilterCountries">UNITSET.FilterCountries</a>: Builds the UNITSET with the units belonging to the country(ies).</li>
<li><a href="##(UNITSET).FilterPrefixes">UNITSET.FilterPrefixes</a>: Builds the UNITSET with the units starting with the same prefix string(s).</li>
</ul>
<p>Once the filter criteria have been set for the UNITSET, you can start filtering using:</p>
<ul>
<li><a href="##(UNITSET).FilterStart">UNITSET.FilterStart</a>: Starts the filtering of the units within the UNITSET.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(UNITSET).FilterZones">UNITSET.FilterZones</a>: Builds the UNITSET with the units within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<h1>UNITSET iterators:</h1>
<p>Once the filters have been defined and the UNITSET has been built, you can iterate the UNITSET with the available iterator methods.
The iterator methods will walk the UNITSET set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the UNITSET:</p>
<ul>
<li><a href="##(UNITSET).ForEachUnit">UNITSET.ForEachUnit</a>: Calls a function for each alive unit it finds within the UNITSET.</li>
</ul>
<p>Planned iterators methods in development are (so these are not yet available):</p>
<ul>
<li><a href="##(UNITSET).ForEachUnitInGroup">UNITSET.ForEachUnitInGroup</a>: Calls a function for each group contained within the UNITSET.</li>
<li><a href="##(UNITSET).ForEachUnitInZone">UNITSET.ForEachUnitInZone</a>: Calls a function for each unit within a certain zone contained within the UNITSET.</li>
</ul>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#UNITSET">UNITSET</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(UNITSET)">Type <code>UNITSET</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).AddInDatabase">UNITSET:AddInDatabase(Event)</a></td>
<td class="summary">
<p>Handles the Database to check on an event (birth) that the Object was added in the Database.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).ClassName">UNITSET.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).Filter">UNITSET.Filter</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).FilterCategories">UNITSET:FilterCategories(Categories)</a></td>
<td class="summary">
<p>Builds a set of units out of categories.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).FilterCoalitions">UNITSET:FilterCoalitions(Coalitions)</a></td>
<td class="summary">
<p>Builds a set of units of coalitions.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).FilterCountries">UNITSET:FilterCountries(Countries)</a></td>
<td class="summary">
<p>Builds a set of units of defined countries.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).FilterMeta">UNITSET.FilterMeta</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).FilterPrefixes">UNITSET:FilterPrefixes(Prefixes)</a></td>
<td class="summary">
<p>Builds a set of units of defined unit prefixes.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).FilterStart">UNITSET:FilterStart()</a></td>
<td class="summary">
<p>Starts the filtering.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).FilterTypes">UNITSET:FilterTypes(Types)</a></td>
<td class="summary">
<p>Builds a set of units of defined unit types.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).FindInDatabase">UNITSET:FindInDatabase(Event)</a></td>
<td class="summary">
<p>Handles the Database to check on any event that Object exists in the Database.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).FindUnit">UNITSET:FindUnit(UnitName)</a></td>
<td class="summary">
<p>Finds a Unit based on the Unit Name.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).ForEachUnit">UNITSET:ForEachUnit(IteratorFunction, ...)</a></td>
<td class="summary">
<p>Interate the UNITSET and call an interator function for each <strong>alive</strong> UNIT, providing the UNIT and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).IsIncludeObject">UNITSET:IsIncludeObject(MUnit)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).New">UNITSET:New()</a></td>
<td class="summary">
<p>Creates a new UNITSET object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UNITSET).Units">UNITSET.Units</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(UNITSET)">#UNITSET</a></em>
<a id="UNITSET" >
<strong>UNITSET</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(UnitSet)" >Type <code>UnitSet</code></a></h2>
<h2><a id="#(UNITSET)" >Type <code>UNITSET</code></a></h2>
<p>UNITSET class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(UNITSET).AddInDatabase" >
<strong>UNITSET:AddInDatabase(Event)</strong>
</a>
</dt>
<dd>
<p>Handles the Database to check on an event (birth) that the Object was added in the Database.</p>
<p>This is required, because sometimes the _DATABASE birth event gets called later than the SET birth event!</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Event.html##(EVENTDATA)">Event#EVENTDATA</a> Event </em></code>: </p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em>#string:</em>
The name of the UNIT</p>
</li>
<li>
<p><em>#table:</em>
The UNIT</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(UNITSET).ClassName" >
<strong>UNITSET.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(UNITSET).Filter" >
<strong>UNITSET.Filter</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).FilterCategories" >
<strong>UNITSET:FilterCategories(Categories)</strong>
</a>
</dt>
<dd>
<p>Builds a set of units out of categories.</p>
<p>Possible current categories are plane, helicopter, ground, ship.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Categories </em></code>:
Can take the following values: "plane", "helicopter", "ground", "ship".</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(UNITSET)">#UNITSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).FilterCoalitions" >
<strong>UNITSET:FilterCoalitions(Coalitions)</strong>
</a>
</dt>
<dd>
<p>Builds a set of units of coalitions.</p>
<p>Possible current coalitions are red, blue and neutral.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Coalitions </em></code>:
Can take the following values: "red", "blue", "neutral".</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(UNITSET)">#UNITSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).FilterCountries" >
<strong>UNITSET:FilterCountries(Countries)</strong>
</a>
</dt>
<dd>
<p>Builds a set of units of defined countries.</p>
<p>Possible current countries are those known within DCS world.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Countries </em></code>:
Can take those country strings known within DCS world.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(UNITSET)">#UNITSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(UNITSET).FilterMeta" >
<strong>UNITSET.FilterMeta</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).FilterPrefixes" >
<strong>UNITSET:FilterPrefixes(Prefixes)</strong>
</a>
</dt>
<dd>
<p>Builds a set of units of defined unit prefixes.</p>
<p>All the units starting with the given prefixes will be included within the set.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Prefixes </em></code>:
The prefix of which the unit name starts with.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(UNITSET)">#UNITSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).FilterStart" >
<strong>UNITSET:FilterStart()</strong>
</a>
</dt>
<dd>
<p>Starts the filtering.</p>
<h3>Return value</h3>
<p><em><a href="##(UNITSET)">#UNITSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).FilterTypes" >
<strong>UNITSET:FilterTypes(Types)</strong>
</a>
</dt>
<dd>
<p>Builds a set of units of defined unit types.</p>
<p>Possible current types are those types known within DCS world.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Types </em></code>:
Can take those type strings known within DCS world.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(UNITSET)">#UNITSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).FindInDatabase" >
<strong>UNITSET:FindInDatabase(Event)</strong>
</a>
</dt>
<dd>
<p>Handles the Database to check on any event that Object exists in the Database.</p>
<p>This is required, because sometimes the _DATABASE event gets called later than the SET event or vise versa!</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Event.html##(EVENTDATA)">Event#EVENTDATA</a> Event </em></code>: </p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em>#string:</em>
The name of the UNIT</p>
</li>
<li>
<p><em>#table:</em>
The UNIT</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).FindUnit" >
<strong>UNITSET:FindUnit(UnitName)</strong>
</a>
</dt>
<dd>
<p>Finds a Unit based on the Unit Name.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string UnitName </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="Unit.html##(UNIT)">Unit#UNIT</a>:</em>
The found Unit.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).ForEachUnit" >
<strong>UNITSET:ForEachUnit(IteratorFunction, ...)</strong>
</a>
</dt>
<dd>
<p>Interate the UNITSET and call an interator function for each <strong>alive</strong> UNIT, providing the UNIT and optional parameters.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#function IteratorFunction </em></code>:
The function that will be called when there is an alive UNIT in the UNITSET. The function needs to accept a UNIT parameter.</p>
</li>
<li>
<p><code><em> ... </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(UNITSET)">#UNITSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).IsIncludeObject" >
<strong>UNITSET:IsIncludeObject(MUnit)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Unit.html##(UNIT)">Unit#UNIT</a> MUnit </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(UNITSET)">#UNITSET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UNITSET).New" >
<strong>UNITSET:New()</strong>
</a>
</dt>
<dd>
<p>Creates a new UNITSET object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.</p>
<h3>Return value</h3>
<p><em><a href="##(UNITSET)">#UNITSET</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- Define a new UNITSET Object. This DBObject will contain a reference to all alive Units.
DBObject = UNITSET:New()</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(UNITSET).Units" >
<strong>UNITSET.Units</strong>
</a>
</dt>
<dd>
</dd>
</dl>
</div>
</div>
</body>
</html>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li>Zone</li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li>env</li>
<li><a href="land.html">land</a></li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -191,7 +193,7 @@
<tr>
<td class="name" nowrap="nowrap"><a href="Database.html">Database</a></td>
<td class="summary">
<p>Manage sets of units and groups.</p>
<p>Manage the mission database.</p>
</td>
</tr>
<tr>
@ -219,9 +221,9 @@
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="MISSION.html">MISSION</a></td>
<td class="name" nowrap="nowrap"><a href="GroupSet.html">GroupSet</a></td>
<td class="summary">
<p>A MISSION is the main owner of a Mission orchestration within MOOSE .</p>
<p>Create and manage a set of groups.</p>
</td>
</tr>
<tr>
@ -246,6 +248,12 @@
<td class="name" nowrap="nowrap"><a href="MissileTrainer.html">MissileTrainer</a></td>
<td class="summary">
<p>Provides missile training functions.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="Mission.html">Mission</a></td>
<td class="summary">
<p>A MISSION is the main owner of a Mission orchestration within MOOSE .</p>
</td>
</tr>
<tr>
@ -325,6 +333,12 @@
<ul>
<li>Support all DCS Unit APIs.</li>
</ul>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="UnitSet.html">UnitSet</a></td>
<td class="summary">
<p>Create and manage a set of units.</p>
</td>
</tr>
<tr>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li>land</li>

View File

@ -42,11 +42,12 @@
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="MISSION.html">MISSION</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
@ -59,6 +60,7 @@
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
@ -1200,8 +1202,6 @@
</dl>
<h2><a id="#(routines)" >Type <code>routines</code></a></h2>
<h2><a id="#(Time)" >Type <code>Time</code></a></h2>
</div>
</div>