Module Database
-Manage sets of units and groups.
+Manage the mission database.
-#Database class
-Mission designers can use the DATABASE class to build sets of units belonging to certain:
+#DATABASE class
+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. -
-
Global(s)
| DATABASE:AddGroup(DCSGroup, GroupName) |
Adds a GROUP based on the GroupName in the DATABASE. + |
+ |||
| DATABASE:AddPlayer(UnitName, PlayerName) | +
+ Adds a player based on the Player Name in the DATABASE. |
|||
| DATABASE.ClassName | +DATABASE.CLIENTSALIVE | |||
| DATABASE.ClientsAlive | +DATABASE.ClassName | @@ -199,24 +169,18 @@ The following iterator methods are currently available within the DATABASE: | DATABASE.DCSUnits | + | +
| DATABASE:DeletePlayer(PlayerName) | +
+ Deletes a player from the DATABASE based on the Player Name. |
|||
| DATABASE:DeleteUnit(DCSUnitName) |
Deletes a Unit from the DATABASE based on the Unit Name. - |
- |||
| DATABASE.Filter | -- - | -|||
| DATABASE.FilterMeta | -- | |||
| DATABASE:ForEach(IteratorFunction, arg, Set) |
- 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. |
|||
| DATABASE:ForEachClient(IteratorFunction, ...) |
- 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 CLIENT, providing the CLIENT to the function and optional parameters. + |
+ |||
| DATABASE:ForEachClientAlive(IteratorFunction, ...) | +
+ Iterate the DATABASE and call an iterator function for each ALIVE CLIENT, providing the CLIENT to the function and optional parameters. |
|||
| DATABASE:ForEachDCSUnit(IteratorFunction, ...) |
- 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. + |
+ |||
| DATABASE:ForEachGroup(IteratorFunction, ...) | +
+ Iterate the DATABASE and call an iterator function for each alive GROUP, providing the GROUP and optional parameters. |
|||
| DATABASE:ForEachPlayer(IteratorFunction, ...) |
- 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 player, providing the player name and optional parameters. + |
+ |||
| DATABASE:ForEachPlayerAlive(IteratorFunction, ...) | +
+ Iterate the DATABASE and call an iterator function for each alive player, providing the Unit of the player and optional parameters. + |
+ |||
| DATABASE:ForEachUnit(IteratorFunction, ...) | +
+ Iterate the DATABASE and call an iterator function for each alive UNIT, providing the UNIT and optional parameters. |
|||
| DATABASE.Players | +DATABASE.PLAYERS | |||
| DATABASE.PlayersAlive | -- - | -|||
| DATABASE:ScanEnvironment() | +DATABASE.PLAYERSALIVE | @@ -313,24 +295,12 @@ The following iterator methods are currently available within the DATABASE: | DATABASE:Spawn(SpawnTemplate) |
Instantiate new Groups within the DCSRTE. - |
-
| DATABASE.Statics | -- | |||
| DATABASE.Templates | - | -|||
| DATABASE:TraceDatabase() | -
- Traces the current database contents in the log ... |
|||
| DATABASE:_EventOnPlayerLeaveUnit(Event) |
Handles the OnPlayerLeaveUnit event to clean the active players table. - |
- |||
| DATABASE:_IsAliveDCSGroup(DCSGroup) | -- - | -|||
| DATABASE:_IsAliveDCSUnit(DCSUnit) | -- - | -|||
| DATABASE:_IsIncludeDCSUnit(DCSUnit) | -- | |||
| DATABASE:_RegisterGroup(GroupTemplate) | +DATABASE:_RegisterPlayers() | +
+ Private method that registers all alive players in the mission. + |
+ ||
| DATABASE:_RegisterTemplate(GroupTemplate) |
Private method that registers new Group Templates within the DATABASE Object. |
|||
| DATABASE:_RegisterPlayers() | +DATABASE:_RegisterTemplates() |
- Private method that registers all alive players in the mission. + |
- + +DATABASE:AddPlayer(UnitName, PlayerName) + + +
-
+
+
Adds a player based on the Player Name in the DATABASE.
+ +Parameters
+-
+
-
+
+
+ +UnitName:
+ -
+
+
+ +PlayerName:
+
+ -
+
+
-
+
- + DATABASE:AddUnit(DCSUnit, DCSUnitName) @@ -513,9 +497,9 @@ The following iterator methods are currently available within the DATABASE:
- - #string - -DATABASE.ClassName + + +DATABASE.CLIENTSALIVE
-
@@ -527,9 +511,9 @@ The following iterator methods are currently available within the DATABASE:
- - - -DATABASE.ClientsAlive + #string + +DATABASE.ClassName
- @@ -564,6 +548,27 @@ The following iterator methods are currently available within the DATABASE: + +
-
+
- + + +DATABASE:DeletePlayer(PlayerName) + + +
-
+
+
Deletes a player from the DATABASE based on the Player Name.
+ +Parameter
+-
+
-
+
+
+ +PlayerName:
+
-
+
+
-
@@ -585,34 +590,6 @@ The following iterator methods are currently available within the DATABASE:
-
- - - - - -DATABASE.Filter - - -
- - - - - -
- - - - -DATABASE.FilterMeta - - -
- - - -
-
-
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.
Parameters
-
@@ -739,7 +716,7 @@ self
-
-
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 CLIENT, providing the CLIENT to the function and optional parameters.
Parameters
-
@@ -765,20 +742,84 @@ self
- - -DATABASE:ForEachDCSUnit(IteratorFunction, ...) + +DATABASE:ForEachClientAlive(IteratorFunction, ...)
-
-
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 CLIENT, providing the CLIENT to the function and optional parameters.
Parameters
-
+The function that will be called when there is an alive CLIENT in the database. The function needs to accept a CLIENT parameter. + +#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 value
+ +#DATABASE: +self
+ +
+ -
- + + +DATABASE:ForEachDCSUnit(IteratorFunction, ...) + + +
-
+
+
Iterate the DATABASE and call an iterator function for each alive unit, providing the DCSUnit and optional parameters.
+ +Parameters
+-
+
-
+
+
+ +#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 value
+ +#DATABASE: +self
+ +
+ -
+
+
- + + +DATABASE:ForEachGroup(IteratorFunction, ...) + + +
-
+
+
Iterate the DATABASE and call an iterator function for each alive GROUP, providing the GROUP and optional parameters.
+ +Parameters
+-
+
-
+
+
#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. -
@@ -803,7 +844,39 @@ self
- -
+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 player, providing the player name and optional parameters.
+ +Parameters
+-
+
-
+
+
+ +#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 value
+ +#DATABASE: +self
+ + - -
-
+
+
- + + +DATABASE:ForEachPlayerAlive(IteratorFunction, ...) + + +
-
+
+
Iterate the DATABASE and call an iterator function for each alive player, providing the Unit of the player and optional parameters.
Parameters
-
@@ -824,6 +897,38 @@ The function that will be called when there is an alive player in the database.
#DATABASE: self
+
+ - + + +DATABASE:ForEachUnit(IteratorFunction, ...) + + +
-
+
+
Iterate the DATABASE and call an iterator function for each alive UNIT, providing the UNIT and optional parameters.
+ +Parameters
+-
+
-
+
+
+ +#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 value
+ +#DATABASE: +self
+ -
+
+
- - -DATABASE.Players + +DATABASE.PLAYERS
- @@ -915,21 +1020,8 @@ DBObject = DATABASE:New()
- - -DATABASE.PlayersAlive - - -
- - - - - -
- - - -DATABASE:ScanEnvironment() + +DATABASE.PLAYERSALIVE
-
@@ -993,20 +1085,6 @@ This method is used by the SPAWN class.
#DATABASE: self
-
- - - - - -DATABASE.Statics - - -
- - - -
-
+
-
+
-
+
-
+
-
@@ -901,8 +1006,8 @@ DBObject = DATABASE:New()
-
-
-
-
-
@@ -1021,27 +1099,6 @@ self
-
-
-
-
- - - -DATABASE:TraceDatabase() - - -
-
-
-
Traces the current database contents in the log ...
- - -(for debug reasons).
- -Return value
- -#DATABASE: -self
- - - -DATABASE:_IsAliveDCSGroup(DCSGroup) - - -
-
-
-
-
-
Parameter
--
-
-
-
-
- -DCSGroup#Group DCSGroup:
-
Return value
- -#DATABASE: -self
- -
- -
-
-
- - - -DATABASE:_IsAliveDCSUnit(DCSUnit) - - -
-
-
-
-
-
Parameter
--
-
-
-
-
- -DCSUnit#Unit DCSUnit:
-
Return value
- -#DATABASE: -self
- -
- -
-
-
- - - -DATABASE:_IsIncludeDCSUnit(DCSUnit) - - -
-
-
-
-
-
Parameter
--
-
-
-
-
- -DCSUnit#Unit DCSUnit:
-
Return value
- -#DATABASE: -self
- -
- -
-
-
- - DATABASE:_RegisterDatabase() @@ -1241,32 +1220,6 @@ self
- - -DATABASE:_RegisterGroup(GroupTemplate) - - -
-
-
-
Private method that registers new Group Templates within the DATABASE Object.
- -Parameter
--
-
-
-
-
- -#table GroupTemplate:
-
Return value
- -#DATABASE: -self
- -
- -
-
-
-
-
DATABASE:_RegisterPlayers()
@@ -1280,6 +1233,45 @@ self
#DATABASE: self
+ + - + + +DATABASE:_RegisterTemplate(GroupTemplate) + + +
-
+
+
Private method that registers new Group Templates within the DATABASE Object.
+ +Parameter
+-
+
-
+
+
+ +#table GroupTemplate:
+
Return value
+ +#DATABASE: +self
+ +
+ -
+
+
- + + +DATABASE:_RegisterTemplates() + + +
- + + +
-
-
-
-
-
@@ -702,7 +679,7 @@ The found Unit.
-
-
-
@@ -1145,84 +1202,6 @@ self
-
-
-
-
-
-
-
-
-
+
-
+
self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, Seconds )
+-
diff --git a/Moose Training/Documentation/Event.html b/Moose Training/Documentation/Event.html
index 153c8cb07..1591464a5 100644
--- a/Moose Training/Documentation/Event.html
+++ b/Moose Training/Documentation/Event.html
@@ -42,11 +42,12 @@
Returns the coalition of the DCS Group.
+