mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
DATABASE
This commit is contained in:
parent
a437da76ec
commit
bf9f02e53a
@ -31,6 +31,7 @@
|
|||||||
-- @module Core.Database
|
-- @module Core.Database
|
||||||
-- @image Core_Database.JPG
|
-- @image Core_Database.JPG
|
||||||
|
|
||||||
|
|
||||||
--- @type DATABASE
|
--- @type DATABASE
|
||||||
-- @field #string ClassName Name of the class.
|
-- @field #string ClassName Name of the class.
|
||||||
-- @field #table Templates Templates: Units, Groups, Statics, ClientsByName, ClientsByID.
|
-- @field #table Templates Templates: Units, Groups, Statics, ClientsByName, ClientsByID.
|
||||||
@ -50,7 +51,7 @@
|
|||||||
-- * PLAYERS
|
-- * PLAYERS
|
||||||
-- * CARGOS
|
-- * CARGOS
|
||||||
--
|
--
|
||||||
-- On top, for internal MOOSE administration purposes, the DATABASE administers the Unit and Group TEMPLATES as defined within the Mission Editor.
|
-- On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Group TEMPLATES as defined within the Mission Editor.
|
||||||
--
|
--
|
||||||
-- The singleton object **_DATABASE** is automatically created by MOOSE, that administers all objects within the mission.
|
-- The singleton object **_DATABASE** is automatically created by MOOSE, that administers all objects within the mission.
|
||||||
-- Moose refers to **_DATABASE** within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.
|
-- Moose refers to **_DATABASE** within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.
|
||||||
@ -89,13 +90,15 @@ DATABASE = {
|
|||||||
FLIGHTCONTROLS = {},
|
FLIGHTCONTROLS = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
local _DATABASECoalition = {
|
local _DATABASECoalition =
|
||||||
|
{
|
||||||
[1] = "Red",
|
[1] = "Red",
|
||||||
[2] = "Blue",
|
[2] = "Blue",
|
||||||
[3] = "Neutral",
|
[3] = "Neutral",
|
||||||
}
|
}
|
||||||
|
|
||||||
local _DATABASECategory = {
|
local _DATABASECategory =
|
||||||
|
{
|
||||||
["plane"] = Unit.Category.AIRPLANE,
|
["plane"] = Unit.Category.AIRPLANE,
|
||||||
["helicopter"] = Unit.Category.HELICOPTER,
|
["helicopter"] = Unit.Category.HELICOPTER,
|
||||||
["vehicle"] = Unit.Category.GROUND_UNIT,
|
["vehicle"] = Unit.Category.GROUND_UNIT,
|
||||||
@ -103,6 +106,7 @@ local _DATABASECategory = {
|
|||||||
["static"] = Unit.Category.STRUCTURE,
|
["static"] = Unit.Category.STRUCTURE,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
--- Creates a new DATABASE object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.
|
--- Creates a new DATABASE object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @return #DATABASE
|
-- @return #DATABASE
|
||||||
@ -151,6 +155,7 @@ function DATABASE:FindUnit( UnitName )
|
|||||||
return UnitFound
|
return UnitFound
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Adds a Unit based on the Unit Name in the DATABASE.
|
--- Adds a Unit based on the Unit Name in the DATABASE.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string DCSUnitName Unit name.
|
-- @param #string DCSUnitName Unit name.
|
||||||
@ -168,6 +173,7 @@ function DATABASE:AddUnit( DCSUnitName )
|
|||||||
return self.UNITS[DCSUnitName]
|
return self.UNITS[DCSUnitName]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Deletes a Unit from the DATABASE based on the Unit Name.
|
--- Deletes a Unit from the DATABASE based on the Unit Name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
function DATABASE:DeleteUnit( DCSUnitName )
|
function DATABASE:DeleteUnit( DCSUnitName )
|
||||||
@ -188,6 +194,7 @@ function DATABASE:AddStatic( DCSStaticName )
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Deletes a Static from the DATABASE based on the Static Name.
|
--- Deletes a Static from the DATABASE based on the Static Name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
function DATABASE:DeleteStatic( DCSStaticName )
|
function DATABASE:DeleteStatic( DCSStaticName )
|
||||||
@ -217,6 +224,7 @@ function DATABASE:AddAirbase( AirbaseName )
|
|||||||
return self.AIRBASES[AirbaseName]
|
return self.AIRBASES[AirbaseName]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Deletes a Airbase from the DATABASE based on the Airbase Name.
|
--- Deletes a Airbase from the DATABASE based on the Airbase Name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string AirbaseName The name of the airbase
|
-- @param #string AirbaseName The name of the airbase
|
||||||
@ -225,6 +233,17 @@ function DATABASE:DeleteAirbase( AirbaseName )
|
|||||||
self.AIRBASES[AirbaseName] = nil
|
self.AIRBASES[AirbaseName] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Finds an AIRBASE based on the AirbaseName.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @param #string AirbaseName
|
||||||
|
-- @return Wrapper.Airbase#AIRBASE The found AIRBASE.
|
||||||
|
function DATABASE:FindAirbase( AirbaseName )
|
||||||
|
|
||||||
|
local AirbaseFound = self.AIRBASES[AirbaseName]
|
||||||
|
return AirbaseFound
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
do -- Zones
|
do -- Zones
|
||||||
|
|
||||||
--- Finds a @{Zone} based on the zone name.
|
--- Finds a @{Zone} based on the zone name.
|
||||||
@ -248,6 +267,7 @@ do -- Zones
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Deletes a @{Zone} from the DATABASE based on the zone name.
|
--- Deletes a @{Zone} from the DATABASE based on the zone name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string ZoneName The name of the zone.
|
-- @param #string ZoneName The name of the zone.
|
||||||
@ -256,6 +276,7 @@ do -- Zones
|
|||||||
self.ZONES[ZoneName] = nil
|
self.ZONES[ZoneName] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Private method that registers new ZONE_BASE derived objects within the DATABASE Object.
|
--- Private method that registers new ZONE_BASE derived objects within the DATABASE Object.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @return #DATABASE self
|
-- @return #DATABASE self
|
||||||
@ -353,6 +374,7 @@ do -- Zones
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end -- zone
|
end -- zone
|
||||||
|
|
||||||
do -- Zone_Goal
|
do -- Zone_Goal
|
||||||
@ -378,6 +400,7 @@ do -- Zone_Goal
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Deletes a @{Zone} from the DATABASE based on the zone name.
|
--- Deletes a @{Zone} from the DATABASE based on the zone name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string ZoneName The name of the zone.
|
-- @param #string ZoneName The name of the zone.
|
||||||
@ -399,6 +422,7 @@ do -- cargo
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Deletes a Cargo from the DATABASE based on the Cargo Name.
|
--- Deletes a Cargo from the DATABASE based on the Cargo Name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string CargoName The name of the airbase
|
-- @param #string CargoName The name of the airbase
|
||||||
@ -492,6 +516,7 @@ function DATABASE:FindClient( ClientName )
|
|||||||
return ClientFound
|
return ClientFound
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Adds a CLIENT based on the ClientName in the DATABASE.
|
--- Adds a CLIENT based on the ClientName in the DATABASE.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string ClientName Name of the Client unit.
|
-- @param #string ClientName Name of the Client unit.
|
||||||
@ -505,6 +530,7 @@ function DATABASE:AddClient( ClientName )
|
|||||||
return self.CLIENTS[ClientName]
|
return self.CLIENTS[ClientName]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Finds a GROUP based on the GroupName.
|
--- Finds a GROUP based on the GroupName.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string GroupName
|
-- @param #string GroupName
|
||||||
@ -515,6 +541,7 @@ function DATABASE:FindGroup( GroupName )
|
|||||||
return GroupFound
|
return GroupFound
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Adds a GROUP based on the GroupName in the DATABASE.
|
--- Adds a GROUP based on the GroupName in the DATABASE.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
function DATABASE:AddGroup( GroupName )
|
function DATABASE:AddGroup( GroupName )
|
||||||
@ -562,6 +589,7 @@ function DATABASE:GetPlayers()
|
|||||||
return self.PLAYERS
|
return self.PLAYERS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Get the player table from the DATABASE, which contains all UNIT objects.
|
--- Get the player table from the DATABASE, which contains all UNIT objects.
|
||||||
-- The player table contains all UNIT objects of the player with the key the name of the player (PlayerName).
|
-- The player table contains all UNIT objects of the player with the key the name of the player (PlayerName).
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
@ -574,6 +602,7 @@ function DATABASE:GetPlayerUnits()
|
|||||||
return self.PLAYERUNITS
|
return self.PLAYERUNITS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Get the player table from the DATABASE which have joined in the mission historically.
|
--- Get the player table from the DATABASE which have joined in the mission historically.
|
||||||
-- The player table contains all UNIT objects with the key the name of the player (PlayerName).
|
-- The player table contains all UNIT objects with the key the name of the player (PlayerName).
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
@ -586,6 +615,7 @@ function DATABASE:GetPlayersJoined()
|
|||||||
return self.PLAYERSJOINED
|
return self.PLAYERSJOINED
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Instantiate new Groups within the DCSRTE.
|
--- 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:
|
-- This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined:
|
||||||
-- SpawnCountryID, SpawnCategoryID
|
-- SpawnCountryID, SpawnCategoryID
|
||||||
@ -718,8 +748,9 @@ function DATABASE:_RegisterGroupTemplate( GroupTemplate, CoalitionSide, Category
|
|||||||
Coalition = self.Templates.Groups[GroupTemplateName].CoalitionID,
|
Coalition = self.Templates.Groups[GroupTemplateName].CoalitionID,
|
||||||
Category = self.Templates.Groups[GroupTemplateName].CategoryID,
|
Category = self.Templates.Groups[GroupTemplateName].CategoryID,
|
||||||
Country = self.Templates.Groups[GroupTemplateName].CountryID,
|
Country = self.Templates.Groups[GroupTemplateName].CountryID,
|
||||||
Units = UnitNames,
|
Units = UnitNames
|
||||||
} )
|
}
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get group template.
|
--- Get group template.
|
||||||
@ -766,8 +797,9 @@ function DATABASE:_RegisterStaticTemplate( StaticTemplate, CoalitionID, Category
|
|||||||
self:T( { Static = self.Templates.Statics[StaticTemplateName].StaticName,
|
self:T( { Static = self.Templates.Statics[StaticTemplateName].StaticName,
|
||||||
Coalition = self.Templates.Statics[StaticTemplateName].CoalitionID,
|
Coalition = self.Templates.Statics[StaticTemplateName].CoalitionID,
|
||||||
Category = self.Templates.Statics[StaticTemplateName].CategoryID,
|
Category = self.Templates.Statics[StaticTemplateName].CategoryID,
|
||||||
Country = self.Templates.Statics[StaticTemplateName].CountryID,
|
Country = self.Templates.Statics[StaticTemplateName].CountryID
|
||||||
} )
|
}
|
||||||
|
)
|
||||||
|
|
||||||
self:AddStatic( StaticTemplateName )
|
self:AddStatic( StaticTemplateName )
|
||||||
|
|
||||||
@ -884,6 +916,8 @@ function DATABASE:GetCategoryFromAirbase( AirbaseName )
|
|||||||
return self.AIRBASES[AirbaseName]:GetCategory()
|
return self.AIRBASES[AirbaseName]:GetCategory()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Private method that registers all alive players in the mission.
|
--- Private method that registers all alive players in the mission.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @return #DATABASE self
|
-- @return #DATABASE self
|
||||||
@ -907,7 +941,8 @@ function DATABASE:_RegisterPlayers()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Private method that registers all Groups and Units within the mission.
|
|
||||||
|
--- Private method that registers all Groups and Units within in the mission.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @return #DATABASE self
|
-- @return #DATABASE self
|
||||||
function DATABASE:_RegisterGroupsAndUnits()
|
function DATABASE:_RegisterGroupsAndUnits()
|
||||||
@ -948,7 +983,7 @@ function DATABASE:_RegisterGroupsAndUnits()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Private method that registers all Units of skill Client or Player within the mission.
|
--- Private method that registers all Units of skill Client or Player within in the mission.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @return #DATABASE self
|
-- @return #DATABASE self
|
||||||
function DATABASE:_RegisterClients()
|
function DATABASE:_RegisterClients()
|
||||||
@ -1019,6 +1054,7 @@ function DATABASE:_RegisterAirbases()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Events
|
--- Events
|
||||||
|
|
||||||
--- Handles the OnBirth event for the alive units set.
|
--- Handles the OnBirth event for the alive units set.
|
||||||
@ -1096,9 +1132,9 @@ function DATABASE:_EventOnBirth( Event )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Handles the OnDead or OnCrash event for alive units set.
|
--- Handles the OnDead or OnCrash event for alive units set.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
@ -1169,6 +1205,7 @@ function DATABASE:_EventOnDeadOrCrash( Event )
|
|||||||
self:AccountDestroys( Event )
|
self:AccountDestroys( Event )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
|
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
@ -1206,6 +1243,7 @@ function DATABASE:_EventOnPlayerEnterUnit( Event )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
@ -1291,6 +1329,7 @@ function DATABASE:ForEach( IteratorFunction, FinalizeFunction, arg, Set )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Iterate the DATABASE and call an iterator function for each **alive** STATIC, providing the STATIC and optional parameters.
|
--- Iterate the DATABASE and call an iterator function for each **alive** STATIC, providing the STATIC and optional parameters.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept a STATIC parameter.
|
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept a STATIC parameter.
|
||||||
@ -1303,6 +1342,7 @@ function DATABASE:ForEachStatic( IteratorFunction, FinalizeFunction, ... ) -- R2
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Iterate the DATABASE and call an iterator 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 UNIT and optional parameters.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept a UNIT parameter.
|
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept a UNIT parameter.
|
||||||
@ -1315,6 +1355,7 @@ function DATABASE:ForEachUnit( IteratorFunction, FinalizeFunction, ... )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Iterate the DATABASE and call an iterator function for each **alive** GROUP, providing the GROUP and optional parameters.
|
--- Iterate the DATABASE and call an iterator function for each **alive** GROUP, providing the GROUP and optional parameters.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept a GROUP parameter.
|
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept a GROUP parameter.
|
||||||
@ -1327,6 +1368,7 @@ function DATABASE:ForEachGroup( IteratorFunction, FinalizeFunction, ... )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Iterate the DATABASE and call an iterator function for each **ALIVE** player, providing the player name and optional parameters.
|
--- Iterate the DATABASE and call an iterator function for each **ALIVE** player, providing the player name and optional parameters.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept the player name.
|
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept the player name.
|
||||||
@ -1339,6 +1381,7 @@ function DATABASE:ForEachPlayer( IteratorFunction, FinalizeFunction, ... )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Iterate the DATABASE and call an iterator function for each player who has joined the mission, providing the Unit of the player and optional parameters.
|
--- Iterate the DATABASE and call an iterator function for each player who has joined the mission, providing the Unit of the player and optional parameters.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept a UNIT parameter.
|
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept a UNIT parameter.
|
||||||
@ -1363,6 +1406,7 @@ function DATABASE:ForEachPlayerUnit( IteratorFunction, FinalizeFunction, ... )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Iterate the DATABASE and call an iterator function for each CLIENT, providing the CLIENT to the function and optional parameters.
|
--- Iterate the DATABASE and call an iterator function for each CLIENT, providing the CLIENT to the function and optional parameters.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #function IteratorFunction The function that will be called object in the database. The function needs to accept a CLIENT parameter.
|
-- @param #function IteratorFunction The function that will be called object in the database. The function needs to accept a CLIENT parameter.
|
||||||
@ -1387,6 +1431,7 @@ function DATABASE:ForEachCargo( IteratorFunction, ... )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Handles the OnEventNewCargo event.
|
--- Handles the OnEventNewCargo event.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
@ -1398,6 +1443,7 @@ function DATABASE:OnEventNewCargo( EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Handles the OnEventDeleteCargo.
|
--- Handles the OnEventDeleteCargo.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
@ -1409,6 +1455,7 @@ function DATABASE:OnEventDeleteCargo( EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Handles the OnEventNewZone event.
|
--- Handles the OnEventNewZone event.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
@ -1420,6 +1467,7 @@ function DATABASE:OnEventNewZone( EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Handles the OnEventDeleteZone.
|
--- Handles the OnEventDeleteZone.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
@ -1431,6 +1479,8 @@ function DATABASE:OnEventDeleteZone( EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Gets the player settings
|
--- Gets the player settings
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string PlayerName
|
-- @param #string PlayerName
|
||||||
@ -1440,6 +1490,7 @@ function DATABASE:GetPlayerSettings( PlayerName )
|
|||||||
return self.PLAYERSETTINGS[PlayerName]
|
return self.PLAYERSETTINGS[PlayerName]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Sets the player settings
|
--- Sets the player settings
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string PlayerName
|
-- @param #string PlayerName
|
||||||
@ -1593,16 +1644,6 @@ function DATABASE:_RegisterTemplates()
|
|||||||
|
|
||||||
local CategoryName = obj_type_name
|
local CategoryName = 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, Template in pairs( obj_type_data.group ) do
|
|
||||||
|
|
||||||
if obj_type_name ~= "static" and Template and Template.units and type( Template.units ) == 'table' then -- making sure again- this is a valid group
|
|
||||||
|
|
||||||
self:_RegisterGroupTemplate( Template, CoalitionSide, _DATABASECategory[string.lower( CategoryName )], CountryID )
|
|
||||||
|
|
||||||
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!
|
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] = {}
|
--self.Units[coa_name][countryName][category] = {}
|
||||||
@ -1631,7 +1672,6 @@ function DATABASE:_RegisterTemplates()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Account the Hits of the Players.
|
--- Account the Hits of the Players.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
|
|||||||
@ -281,8 +281,6 @@ end
|
|||||||
-- @return #string Source file name.
|
-- @return #string Source file name.
|
||||||
-- @return #string Line number.
|
-- @return #string Line number.
|
||||||
-- @return #number Function time in seconds.
|
-- @return #number Function time in seconds.
|
||||||
function PROFILER.getData( func )
|
|
||||||
|
|
||||||
function PROFILER.getData( func )
|
function PROFILER.getData( func )
|
||||||
|
|
||||||
local n=PROFILER.dInfo[func]
|
local n=PROFILER.dInfo[func]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user