Module GroupSet
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.FilterCountries: Builds the GROUPSET with the gruops belonging to the country(ies).
- 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 group it finds within the GROUPSET.
Global(s)
| GROUPSET |
Type GROUPSET
| GROUPSET:AddInDatabase(Event) |
Handles the Database to check on an event (birth) that the Object was added in the Database. |
| GROUPSET.ClassName | |
| GROUPSET.Filter | |
| GROUPSET:FilterCategories(Categories) |
Builds a set of groups out of categories. |
| GROUPSET:FilterCoalitions(Coalitions) |
Builds a set of groups of coalitions. |
| GROUPSET:FilterCountries(Countries) |
Builds a set of groups of defined countries. |
| GROUPSET.FilterMeta | |
| GROUPSET:FilterPrefixes(Prefixes) |
Builds a set of groups of defined GROUP prefixes. |
| GROUPSET:FilterStart() |
Starts the filtering. |
| GROUPSET:FindGroup(GroupName) |
Finds a Group based on the Group Name. |
| GROUPSET:FindInDatabase(Event) |
Handles the Database to check on any event that Object exists in the Database. |
| GROUPSET:ForEachGroup(IteratorFunction, ...) |
Interate the GROUPSET and call an interator function for each alive GROUP, providing the GROUP and optional parameters. |
| GROUPSET:IsIncludeObject(MooseGroup) | |
| GROUPSET:New() |
Creates a new GROUPSET object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names. |
Global(s)
Type GroupSet
Type GROUPSET
GROUPSET class
Field(s)
- GROUPSET:AddInDatabase(Event)
-
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!
Parameter
-
Event#EVENTDATA Event:
Return values
-
#string: The name of the GROUP
-
#table: The GROUP
-
- #string GROUPSET.ClassName
- GROUPSET:FilterCategories(Categories)
-
Builds a set of groups out of categories.
Possible current categories are plane, helicopter, ground, ship.
Parameter
-
#string Categories: Can take the following values: "plane", "helicopter", "ground", "ship".
Return value
#GROUPSET: self
-
- GROUPSET:FilterCoalitions(Coalitions)
-
Builds a set of groups of coalitions.
Possible current coalitions are red, blue and neutral.
Parameter
-
#string Coalitions: Can take the following values: "red", "blue", "neutral".
Return value
#GROUPSET: self
-
- GROUPSET:FilterCountries(Countries)
-
Builds a set of groups of defined countries.
Possible current countries are those known within DCS world.
Parameter
-
#string Countries: Can take those country strings known within DCS world.
Return value
#GROUPSET: self
-
- GROUPSET:FilterPrefixes(Prefixes)
-
Builds a set of groups of defined GROUP prefixes.
All the groups starting with the given prefixes will be included within the set.
Parameter
-
#string Prefixes: The prefix of which the group name starts with.
Return value
#GROUPSET: self
-
- GROUPSET:FilterStart()
-
Starts the filtering.
Return value
#GROUPSET: self
- GROUPSET:FindGroup(GroupName)
-
Finds a Group based on the Group Name.
Parameter
-
#string GroupName:
Return value
Group#GROUP: The found Group.
-
- GROUPSET:FindInDatabase(Event)
-
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!
Parameter
-
Event#EVENTDATA Event:
Return values
-
#string: The name of the GROUP
-
#table: The GROUP
-
- GROUPSET:ForEachGroup(IteratorFunction, ...)
-
Interate the GROUPSET and call an interator 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 GROUPSET. The function needs to accept a GROUP parameter. -
...:
Return value
#GROUPSET: self
-
- GROUPSET:IsIncludeObject(MooseGroup)
-
Parameter
-
Group#GROUP MooseGroup:
Return value
#GROUPSET: self
-
- GROUPSET:New()
-
Creates a new GROUPSET object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.
Return value
Usage:
-- Define a new GROUPSET Object. This DBObject will contain a reference to all alive GROUPS. DBObject = GROUPSET:New()