- Added COHORTs and LEGIONs to database
This commit is contained in:
Frank
2026-06-05 22:50:52 +02:00
parent 3d1dcd78a3
commit 599a2ba6fb
3 changed files with 41 additions and 0 deletions
+36
View File
@@ -92,6 +92,8 @@ DATABASE = {
ZONES_GOAL = {},
WAREHOUSES = {},
FLIGHTGROUPS = {},
COHORTS={},
LEGIONS={},
FLIGHTCONTROLS = {},
OPSZONES = {},
PATHLINES = {},
@@ -2086,6 +2088,40 @@ function DATABASE:FindOpsGroupFromUnit(unitname)
end
end
--
--- Add an OPS COHORT (SQUADRON, PLATOON, FLOTILLA) to the data base.
-- @param #DATABASE self
-- @param Ops.Cohort#COHORT cohort The cohort added to the DB.
function DATABASE:AddCohort(cohort)
self.COHORTS[cohort.name]=cohort
end
--- Find an OPS COHORT (SQUADRON, PLATOON, FLOTILLA) in the data base.
-- @param #DATABASE self
-- @param #string cohortname Name of the cohort.
-- @return Ops.Cohort#COHORT Cohort object.
function DATABASE:FindCohort(cohortname)
return self.COHORTS[cohortname]
end
--- Add an OPS LEGION (AIRWING, BRIGADE, FLEET) to the data base.
-- @param #DATABASE self
-- @param Ops.Legion#LEGION legion The legion added to the DB.
function DATABASE:AddLegion(legion)
self.COHORTS[legion.alias]=legion
end
--- Find an OPS LEGION (AIRWING, BRIGADE, FLEET) in the data base.
-- @param #DATABASE self
-- @param #string legionname Name of the legion.
-- @return Ops.Legion#LEGION Legion object.
function DATABASE:FindLegion(legionname)
return self.COHORTS[legionname]
end
--
--- Add a flight control to the data base.
-- @param #DATABASE self
-- @param OPS.FlightControl#FLIGHTCONTROL flightcontrol
+3
View File
@@ -318,6 +318,9 @@ function COHORT:New(TemplateGroupName, Ngroups, CohortName)
-- @param #string Event Event.
-- @param #string To To state.
-- Add cohort to DB
_DATABASE:AddCohort(self)
return self
end
+2
View File
@@ -306,6 +306,8 @@ function LEGION:New(WarehouseName, LegionName)
-- @param Ops.Cohort#COHORT Cohort The cohort the asset belongs to.
-- @param Functional.Warehouse#WAREHOUSE.Assetitem Asset The asset that returned.
-- Add legion to DB
_DATABASE:AddLegion(self)
return self
end