Module Set
This module contains the SET classes.
1) Core.Set#SET_BASE class, extends Core.Base#BASE
The Core.Set#SET_BASE class defines the core functions that define a collection of objects. A SET provides iterators to iterate the SET, but will temporarily yield the ForEach interator loop at defined "intervals" to the mail simulator loop. In this way, large loops can be done while not blocking the simulator main processing loop. The default "yield interval" is after 10 objects processed. The default "time interval" is after 0.001 seconds.
1.1) Add or remove objects from the SET
Some key core functions are Core.Set#SET_BASE.Add and Core.Set#SET_BASE.Remove to add or remove objects from the SET in your logic.
1.2) Define the SET iterator "yield interval" and the "time interval"
Modify the iterator intervals with the Core.Set#SET_BASE.SetInteratorIntervals method. You can set the "yield interval", and the "time interval". (See above).
2) Core.Set#SET_GROUP class, extends Core.Set#SET_BASE
Mission designers can use the Core.Set#SET_GROUP class to build sets of groups belonging to certain:
- Coalitions
- Categories
- Countries
- Starting with certain prefix strings.
2.1) SET_GROUP construction method:
Create a new SET_GROUP object with the SET_GROUP.New method:
- SET_GROUP.New: Creates a new SET_GROUP object.
2.2) Add or Remove GROUP(s) from SET_GROUP:
GROUPS can be added and removed using the Core.Set#SET_GROUP.AddGroupsByName and Core.Set#SET_GROUP.RemoveGroupsByName respectively. These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
2.3) SET_GROUP filter criteria:
You can set filter criteria to define the set of groups within the SET_GROUP. Filter criteria are defined by:
- SET_GROUP.FilterCoalitions: Builds the SET_GROUP with the groups belonging to the coalition(s).
- SET_GROUP.FilterCategories: Builds the SET_GROUP with the groups belonging to the category(ies).
- SET_GROUP.FilterCountries: Builds the SET_GROUP with the gruops belonging to the country(ies).
- SET_GROUP.FilterPrefixes: Builds the SET_GROUP with the groups starting with the same prefix string(s).
Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
- SET_GROUP.FilterStart: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects dynamically.
Planned filter criteria within development are (so these are not yet available):
- SET_GROUP.FilterZones: Builds the SET_GROUP with the groups within a Core.Zone#ZONE.
2.4) SET_GROUP iterators:
Once the filters have been defined and the SETGROUP has been built, you can iterate the SETGROUP with the available iterator methods. The iterator methods will walk the SETGROUP set, and call for each element within the set a function that you provide. The following iterator methods are currently available within the SETGROUP:
- SET_GROUP.ForEachGroup: Calls a function for each alive group it finds within the SET_GROUP.
- SET_GROUP.ForEachGroupCompletelyInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence completely in a Zone, providing the GROUP and optional parameters to the called function.
- SET_GROUP.ForEachGroupPartlyInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence partly in a Zone, providing the GROUP and optional parameters to the called function.
- SET_GROUP.ForEachGroupNotInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence not in a Zone, providing the GROUP and optional parameters to the called function.
3) Core.Set#SET_UNIT class, extends Core.Set#SET_BASE
Mission designers can use the Core.Set#SET_UNIT class to build sets of units belonging to certain:
- Coalitions
- Categories
- Countries
- Unit types
- Starting with certain prefix strings.
3.1) SET_UNIT construction method:
Create a new SET_UNIT object with the SET_UNIT.New method:
- SET_UNIT.New: Creates a new SET_UNIT object.
3.2) Add or Remove UNIT(s) from SET_UNIT:
UNITs can be added and removed using the Core.Set#SET_UNIT.AddUnitsByName and Core.Set#SET_UNIT.RemoveUnitsByName respectively. These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
3.3) SET_UNIT filter criteria:
You can set filter criteria to define the set of units within the SET_UNIT. Filter criteria are defined by:
- SET_UNIT.FilterCoalitions: Builds the SET_UNIT with the units belonging to the coalition(s).
- SET_UNIT.FilterCategories: Builds the SET_UNIT with the units belonging to the category(ies).
- SET_UNIT.FilterTypes: Builds the SET_UNIT with the units belonging to the unit type(s).
- SET_UNIT.FilterCountries: Builds the SET_UNIT with the units belonging to the country(ies).
- SET_UNIT.FilterPrefixes: Builds the SET_UNIT with the units starting with the same prefix string(s).
Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
- SET_UNIT.FilterStart: Starts the filtering of the units within the SET_UNIT.
Planned filter criteria within development are (so these are not yet available):
- SET_UNIT.FilterZones: Builds the SET_UNIT with the units within a Core.Zone#ZONE.
3.4) SET_UNIT iterators:
Once the filters have been defined and the SETUNIT has been built, you can iterate the SETUNIT with the available iterator methods. The iterator methods will walk the SETUNIT set, and call for each element within the set a function that you provide. The following iterator methods are currently available within the SETUNIT:
- SET_UNIT.ForEachUnit: Calls a function for each alive unit it finds within the SET_UNIT.
- SET_GROUP.ForEachGroupCompletelyInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence completely in a Zone, providing the GROUP and optional parameters to the called function.
- SET_GROUP.ForEachGroupNotInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence not in a Zone, providing the GROUP and optional parameters to the called function.
Planned iterators methods in development are (so these are not yet available):
- SET_UNIT.ForEachUnitInUnit: Calls a function for each unit contained within the SET_UNIT.
- SET_UNIT.ForEachUnitCompletelyInZone: Iterate and call an iterator function for each alive UNIT presence completely in a Zone, providing the UNIT and optional parameters to the called function.
- SET_UNIT.ForEachUnitNotInZone: Iterate and call an iterator function for each alive UNIT presence not in a Zone, providing the UNIT and optional parameters to the called function.
4) Core.Set#SET_CLIENT class, extends Core.Set#SET_BASE
Mission designers can use the Core.Set#SET_CLIENT class to build sets of units belonging to certain:
- Coalitions
- Categories
- Countries
- Client types
- Starting with certain prefix strings.
4.1) SET_CLIENT construction method:
Create a new SET_CLIENT object with the SET_CLIENT.New method:
- SET_CLIENT.New: Creates a new SET_CLIENT object.
4.2) Add or Remove CLIENT(s) from SET_CLIENT:
CLIENTs can be added and removed using the Core.Set#SET_CLIENT.AddClientsByName and Core.Set#SET_CLIENT.RemoveClientsByName respectively. These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
4.3) SET_CLIENT filter criteria:
You can set filter criteria to define the set of clients within the SET_CLIENT. Filter criteria are defined by:
- SET_CLIENT.FilterCoalitions: Builds the SET_CLIENT with the clients belonging to the coalition(s).
- SET_CLIENT.FilterCategories: Builds the SET_CLIENT with the clients belonging to the category(ies).
- SET_CLIENT.FilterTypes: Builds the SET_CLIENT with the clients belonging to the client type(s).
- SET_CLIENT.FilterCountries: Builds the SET_CLIENT with the clients belonging to the country(ies).
- SET_CLIENT.FilterPrefixes: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
- SET_CLIENT.FilterStart: Starts the filtering of the clients within the SET_CLIENT.
Planned filter criteria within development are (so these are not yet available):
- SET_CLIENT.FilterZones: Builds the SET_CLIENT with the clients within a Core.Zone#ZONE.
4.4) SET_CLIENT iterators:
Once the filters have been defined and the SETCLIENT has been built, you can iterate the SETCLIENT with the available iterator methods. The iterator methods will walk the SETCLIENT set, and call for each element within the set a function that you provide. The following iterator methods are currently available within the SETCLIENT:
- SET_CLIENT.ForEachClient: Calls a function for each alive client it finds within the SET_CLIENT.
5) Core.Set#SET_AIRBASE class, extends Core.Set#SET_BASE
Mission designers can use the Core.Set#SET_AIRBASE class to build sets of airbases optionally belonging to certain:
- Coalitions
5.1) SET_AIRBASE construction
Create a new SET_AIRBASE object with the SET_AIRBASE.New method:
- SET_AIRBASE.New: Creates a new SET_AIRBASE object.
5.2) Add or Remove AIRBASEs from SET_AIRBASE
AIRBASEs can be added and removed using the Core.Set#SET_AIRBASE.AddAirbasesByName and Core.Set#SET_AIRBASE.RemoveAirbasesByName respectively. These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
5.3) SET_AIRBASE filter criteria
You can set filter criteria to define the set of clients within the SET_AIRBASE. Filter criteria are defined by:
- SET_AIRBASE.FilterCoalitions: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
- SET_AIRBASE.FilterStart: Starts the filtering of the airbases within the SET_AIRBASE.
5.4) SET_AIRBASE iterators:
Once the filters have been defined and the SETAIRBASE has been built, you can iterate the SETAIRBASE with the available iterator methods. The iterator methods will walk the SETAIRBASE set, and call for each airbase within the set a function that you provide. The following iterator methods are currently available within the SETAIRBASE:
- SET_AIRBASE.ForEachAirbase: Calls a function for each airbase it finds within the SET_AIRBASE.
Authors:
- FlightControl : Design & Programming
Contributions:
Global(s)
| SET_AIRBASE | |
| SET_BASE | |
| SET_CLIENT | |
| SET_GROUP | |
| SET_UNIT |
Type SET_AIRBASE
| SET_AIRBASE:AddAirbasesByName(AddAirbaseNames) |
Add AIRBASEs to SET_AIRBASE. |
| SET_AIRBASE:AddInDatabase(Event) |
Handles the Database to check on an event (birth) that the Object was added in the Database. |
| SET_AIRBASE.Airbases | |
| SET_AIRBASE.ClassName | |
| SET_AIRBASE.Filter | |
| SET_AIRBASE:FilterCategories(Categories) |
Builds a set of airbases out of categories. |
| SET_AIRBASE:FilterCoalitions(Coalitions) |
Builds a set of airbases of coalitions. |
| SET_AIRBASE.FilterMeta | |
| SET_AIRBASE:FilterStart() |
Starts the filtering. |
| SET_AIRBASE:FindAirbase(AirbaseName) |
Finds a Airbase based on the Airbase Name. |
| SET_AIRBASE:FindInDatabase(Event) |
Handles the Database to check on any event that Object exists in the Database. |
| SET_AIRBASE:FindNearestAirbaseFromPointVec2(PointVec2) |
Iterate the SET_AIRBASE while identifying the nearest Wrapper.Airbase#AIRBASE from a Core.Point#POINT_VEC2. |
| SET_AIRBASE:ForEachAirbase(IteratorFunction, ...) |
Iterate the SET_AIRBASE and call an interator function for each AIRBASE, providing the AIRBASE and optional parameters. |
| SET_AIRBASE:IsIncludeObject(MAirbase) | |
| SET_AIRBASE:New() |
Creates a new SET_AIRBASE object, building a set of airbases belonging to a coalitions and categories. |
| SET_AIRBASE:RemoveAirbasesByName(RemoveAirbaseNames) |
Remove AIRBASEs from SET_AIRBASE. |
Type SET_BASE
| SET_BASE:Add(ObjectName, Object) |
Adds a Core.Base#BASE object in the Core.Set#SET_BASE, using a given ObjectName as the index. |
| SET_BASE:AddObject(Object) |
Adds a Core.Base#BASE object in the Core.Set#SET_BASE, using the Object Name as the index. |
| SET_BASE.CallScheduler | |
| SET_BASE.ClassName | |
| SET_BASE:Count() |
Retrieves the amount of objects in the Core.Set#SET_BASE and derived classes. |
| SET_BASE.Database | |
| SET_BASE.Filter | |
| SET_BASE:FilterOnce() |
Filters for the defined collection. |
| SET_BASE:FilterStop() |
Stops the filtering for the defined collection. |
| SET_BASE:FindNearestObjectFromPointVec2(PointVec2) |
Iterate the SET_BASE while identifying the nearest object from a Core.Point#POINT_VEC2. |
| SET_BASE:Flush() |
Flushes the current SET_BASE contents in the log ... |
| SET_BASE:ForEach(IteratorFunction, arg, Set, Function, FunctionArguments) |
Iterate the SETBASE and derived classes and call an iterator function for the given SETBASE, providing the Object for each element within the set and optional parameters. |
| SET_BASE:Get(ObjectName) |
Gets a Core.Base#BASE object from the Core.Set#SET_BASE and derived classes, based on the Object Name. |
| SET_BASE:GetSet() |
Gets the Set. |
| SET_BASE:IsIncludeObject(Object) |
Decides whether to include the Object |
| SET_BASE.List | |
| SET_BASE:New(Database) |
Creates a new SET_BASE object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names. |
| SET_BASE:Remove(ObjectName) |
Removes a Core.Base#BASE object from the Core.Set#SET_BASE and derived classes, based on the Object Name. |
| SET_BASE.Set | |
| SET_BASE:SetDatabase(BaseSet) |
Copies the Filter criteria from a given Set (for rebuilding a new Set based on an existing Set). |
| SET_BASE:SetIteratorIntervals(YieldInterval, TimeInterval) |
Define the SET iterator "yield interval" and the "time interval". |
| SET_BASE.TimeInterval | |
| SET_BASE.YieldInterval | |
| SET_BASE:_EventOnBirth(Event) |
Handles the OnBirth event for the Set. |
| SET_BASE:_EventOnDeadOrCrash(Event) |
Handles the OnDead or OnCrash event for alive units set. |
| SET_BASE:_EventOnPlayerEnterUnit(Event) |
Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied). |
| SET_BASE:_EventOnPlayerLeaveUnit(Event) |
Handles the OnPlayerLeaveUnit event to clean the active players table. |
| SET_BASE:_FilterStart() |
Starts the filtering for the defined collection. |
| SET_BASE:_Find(ObjectName) |
Finds an Core.Base#BASE object based on the object Name. |
Type SET_CLIENT
| SET_CLIENT:AddClientsByName(AddClientNames) |
Add CLIENT(s) to SET_CLIENT. |
| SET_CLIENT:AddInDatabase(Event) |
Handles the Database to check on an event (birth) that the Object was added in the Database. |
| SET_CLIENT.ClassName | |
| SET_CLIENT.Clients | |
| SET_CLIENT.Filter | |
| SET_CLIENT:FilterCategories(Categories) |
Builds a set of clients out of categories. |
| SET_CLIENT:FilterCoalitions(Coalitions) |
Builds a set of clients of coalitions. |
| SET_CLIENT:FilterCountries(Countries) |
Builds a set of clients of defined countries. |
| SET_CLIENT.FilterMeta | |
| SET_CLIENT:FilterPrefixes(Prefixes) |
Builds a set of clients of defined client prefixes. |
| SET_CLIENT:FilterStart() |
Starts the filtering. |
| SET_CLIENT:FilterTypes(Types) |
Builds a set of clients of defined client types. |
| SET_CLIENT:FindClient(ClientName) |
Finds a Client based on the Client Name. |
| SET_CLIENT:FindInDatabase(Event) |
Handles the Database to check on any event that Object exists in the Database. |
| SET_CLIENT:ForEachClient(IteratorFunction, ...) |
Iterate the SET_CLIENT and call an interator function for each alive CLIENT, providing the CLIENT and optional parameters. |
| SET_CLIENT:ForEachClientInZone(ZoneObject, IteratorFunction, ...) |
Iterate the SET_CLIENT and call an iterator function for each alive CLIENT presence completely in a Zone, providing the CLIENT and optional parameters to the called function. |
| SET_CLIENT:ForEachClientNotInZone(ZoneObject, IteratorFunction, ...) |
Iterate the SET_CLIENT and call an iterator function for each alive CLIENT presence not in a Zone, providing the CLIENT and optional parameters to the called function. |
| SET_CLIENT:IsIncludeObject(MClient) | |
| SET_CLIENT:New() |
Creates a new SET_CLIENT object, building a set of clients belonging to a coalitions, categories, countries, types or with defined prefix names. |
| SET_CLIENT:RemoveClientsByName(RemoveClientNames) |
Remove CLIENT(s) from SET_CLIENT. |
Type SET_GROUP
| SET_GROUP:AddGroupsByName(AddGroupNames) |
Add GROUP(s) to SET_GROUP. |
| SET_GROUP:AddInDatabase(Event) |
Handles the Database to check on an event (birth) that the Object was added in the Database. |
| SET_GROUP.ClassName | |
| SET_GROUP.Filter | |
| SET_GROUP:FilterCategories(Categories) |
Builds a set of groups out of categories. |
| SET_GROUP:FilterCoalitions(Coalitions) |
Builds a set of groups of coalitions. |
| SET_GROUP:FilterCountries(Countries) |
Builds a set of groups of defined countries. |
| SET_GROUP.FilterMeta | |
| SET_GROUP:FilterPrefixes(Prefixes) |
Builds a set of groups of defined GROUP prefixes. |
| SET_GROUP:FilterStart() |
Starts the filtering. |
| SET_GROUP:FindGroup(GroupName) |
Finds a Group based on the Group Name. |
| SET_GROUP:FindInDatabase(Event) |
Handles the Database to check on any event that Object exists in the Database. |
| SET_GROUP:ForEachGroup(IteratorFunction, ...) |
Iterate the SET_GROUP and call an iterator function for each alive GROUP, providing the GROUP and optional parameters. |
| SET_GROUP:ForEachGroupCompletelyInZone(ZoneObject, IteratorFunction, ...) |
Iterate the SET_GROUP and call an iterator function for each alive GROUP presence completely in a Zone, providing the GROUP and optional parameters to the called function. |
| SET_GROUP:ForEachGroupNotInZone(ZoneObject, IteratorFunction, ...) |
Iterate the SET_GROUP and call an iterator function for each alive GROUP presence not in a Zone, providing the GROUP and optional parameters to the called function. |
| SET_GROUP:ForEachGroupPartlyInZone(ZoneObject, IteratorFunction, ...) |
Iterate the SET_GROUP and call an iterator function for each alive GROUP presence partly in a Zone, providing the GROUP and optional parameters to the called function. |
| SET_GROUP:IsIncludeObject(MooseGroup) | |
| SET_GROUP:New() |
Creates a new SET_GROUP object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names. |
| SET_GROUP:RemoveGroupsByName(RemoveGroupNames) |
Remove GROUP(s) from SET_GROUP. |
Type SET_UNIT
| SET_UNIT:AddInDatabase(Event) |
Handles the Database to check on an event (birth) that the Object was added in the Database. |
| SET_UNIT:AddUnit(AddUnit) |
Add UNIT(s) to SET_UNIT. |
| SET_UNIT:AddUnitsByName(AddUnitNames) |
Add UNIT(s) to SET_UNIT. |
| SET_UNIT:CalculateThreatLevelA2G() |
Calculate the maxium A2G threat level of the SET_UNIT. |
| SET_UNIT.ClassName | |
| SET_UNIT.Filter | |
| SET_UNIT:FilterCategories(Categories) |
Builds a set of units out of categories. |
| SET_UNIT:FilterCoalitions(Coalitions) |
Builds a set of units of coalitions. |
| SET_UNIT:FilterCountries(Countries) |
Builds a set of units of defined countries. |
| SET_UNIT:FilterHasRadar(RadarTypes) |
Builds a set of units having a radar of give types. |
| SET_UNIT:FilterHasSEAD() |
Builds a set of SEADable units. |
| SET_UNIT.FilterMeta | |
| SET_UNIT:FilterPrefixes(Prefixes) |
Builds a set of units of defined unit prefixes. |
| SET_UNIT:FilterStart() |
Starts the filtering. |
| SET_UNIT:FilterTypes(Types) |
Builds a set of units of defined unit types. |
| SET_UNIT:FindInDatabase(Event) |
Handles the Database to check on any event that Object exists in the Database. |
| SET_UNIT:FindUnit(UnitName) |
Finds a Unit based on the Unit Name. |
| SET_UNIT:ForEachUnit(IteratorFunction, ...) |
Iterate the SET_UNIT and call an interator function for each alive UNIT, providing the UNIT and optional parameters. |
| SET_UNIT:ForEachUnitCompletelyInZone(ZoneObject, IteratorFunction, ...) |
Iterate the SET_UNIT and call an iterator function for each alive UNIT presence completely in a Zone, providing the UNIT and optional parameters to the called function. |
| SET_UNIT:ForEachUnitNotInZone(ZoneObject, IteratorFunction, ...) |
Iterate the SET_UNIT and call an iterator function for each alive UNIT presence not in a Zone, providing the UNIT and optional parameters to the called function. |
| SET_UNIT:GetUnitThreatLevels() |
Returns map of unit threat levels. |
| SET_UNIT:GetUnitTypes() |
Returns map of unit types. |
| SET_UNIT:GetUnitTypesText() |
Returns a comma separated string of the unit types with a count in the Set. |
| SET_UNIT:HasFriendlyUnits(FriendlyCoalition) |
Returns if the Set has friendly ground units. |
| SET_UNIT:HasGroundUnits() |
Returns if the Set has ground targets. |
| SET_UNIT:HasRadar(RadarType) |
Returns if the Set has targets having a radar (of a given type). |
| SET_UNIT:HasSEAD() |
Returns if the Set has targets that can be SEADed. |
| SET_UNIT:IsIncludeObject(MUnit) | |
| SET_UNIT:New() |
Creates a new SET_UNIT object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names. |
| SET_UNIT:RemoveUnitsByName(RemoveUnitNames) |
Remove UNIT(s) from SET_UNIT. |
| SET_UNIT.Units |
Global(s)
Type Set
Type SET_AIRBASE
SET_AIRBASE class
Field(s)
- SET_AIRBASE:AddAirbasesByName(AddAirbaseNames)
-
Add AIRBASEs to SET_AIRBASE.
Parameter
-
#string AddAirbaseNames: A single name or an array of AIRBASE names.
Return value
self
-
- SET_AIRBASE: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 SETBASE birth event!
Parameter
-
Core.Event#EVENTDATA Event:
Return values
-
#string: The name of the AIRBASE
-
#table: The AIRBASE
-
- #string SET_AIRBASE.ClassName
- SET_AIRBASE:FilterCategories(Categories)
-
Builds a set of airbases out of categories.
Possible current categories are plane, helicopter, ground, ship.
Parameter
-
#string Categories: Can take the following values: "airdrome", "helipad", "ship".
Return value
#SET_AIRBASE: self
-
- SET_AIRBASE:FilterCoalitions(Coalitions)
-
Builds a set of airbases of coalitions.
Possible current coalitions are red, blue and neutral.
Parameter
-
#string Coalitions: Can take the following values: "red", "blue", "neutral".
Return value
#SET_AIRBASE: self
-
- SET_AIRBASE:FilterStart()
-
Starts the filtering.
Return value
#SET_AIRBASE: self
- SET_AIRBASE:FindAirbase(AirbaseName)
-
Finds a Airbase based on the Airbase Name.
Parameter
-
#string AirbaseName:
Return value
Wrapper.Airbase#AIRBASE: The found Airbase.
-
- SET_AIRBASE: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 SETBASE event or vise versa!
Parameter
-
Core.Event#EVENTDATA Event:
Return values
-
#string: The name of the AIRBASE
-
#table: The AIRBASE
-
- SET_AIRBASE:FindNearestAirbaseFromPointVec2(PointVec2)
-
Iterate the SET_AIRBASE while identifying the nearest Wrapper.Airbase#AIRBASE from a Core.Point#POINT_VEC2.
Parameter
-
Core.Point#POINT_VEC2 PointVec2: A Core.Point#POINT_VEC2 object from where to evaluate the closest Wrapper.Airbase#AIRBASE.
Return value
Wrapper.Airbase#AIRBASE: The closest Wrapper.Airbase#AIRBASE.
-
- SET_AIRBASE:ForEachAirbase(IteratorFunction, ...)
-
Iterate the SET_AIRBASE and call an interator function for each AIRBASE, providing the AIRBASE and optional parameters.
Parameters
-
#function IteratorFunction: The function that will be called when there is an alive AIRBASE in the SET_AIRBASE. The function needs to accept a AIRBASE parameter. -
...:
Return value
#SET_AIRBASE: self
-
- SET_AIRBASE:IsIncludeObject(MAirbase)
-
Parameter
-
Wrapper.Airbase#AIRBASE MAirbase:
Return value
#SET_AIRBASE: self
-
- SET_AIRBASE:New()
-
Creates a new SET_AIRBASE object, building a set of airbases belonging to a coalitions and categories.
Return value
#SET_AIRBASE: self
Usage:
-- Define a new SET_AIRBASE Object. The DatabaseSet will contain a reference to all Airbases. DatabaseSet = SET_AIRBASE:New()
- SET_AIRBASE:RemoveAirbasesByName(RemoveAirbaseNames)
-
Remove AIRBASEs from SET_AIRBASE.
Parameter
-
Wrapper.Airbase#AIRBASE RemoveAirbaseNames: A single name or an array of AIRBASE names.
Return value
self
-
Type SET_BASE
SET_BASE class
Field(s)
- SET_BASE:Add(ObjectName, Object)
-
Adds a Core.Base#BASE object in the Core.Set#SET_BASE, using a given ObjectName as the index.
Parameters
-
#string ObjectName: -
Core.Base#BASE Object:
Return value
Core.Base#BASE: The added BASE Object.
-
- SET_BASE:AddObject(Object)
-
Adds a Core.Base#BASE object in the Core.Set#SET_BASE, using the Object Name as the index.
Parameter
-
Wrapper.Object#OBJECT Object:
Return value
Core.Base#BASE: The added BASE Object.
-
- #string SET_BASE.ClassName
- SET_BASE:Count()
-
Retrieves the amount of objects in the Core.Set#SET_BASE and derived classes.
Return value
#number: Count
- SET_BASE.Database
-
Now base the new Set on the BaseSet
- #table SET_BASE.Filter
- SET_BASE:FilterOnce()
-
Filters for the defined collection.
Return value
#SET_BASE: self
- SET_BASE:FilterStop()
-
Stops the filtering for the defined collection.
Return value
#SET_BASE: self
- SET_BASE:FindNearestObjectFromPointVec2(PointVec2)
-
Iterate the SET_BASE while identifying the nearest object from a Core.Point#POINT_VEC2.
Parameter
-
Core.Point#POINT_VEC2 PointVec2: A Core.Point#POINT_VEC2 object from where to evaluate the closest object in the set.
Return value
Core.Base#BASE: The closest object.
-
- SET_BASE:Flush()
-
Flushes the current SET_BASE contents in the log ...
(for debugging reasons).
Return value
#string: A string with the names of the objects.
- SET_BASE:ForEach(IteratorFunction, arg, Set, Function, FunctionArguments)
-
Iterate the SETBASE and derived classes and call an iterator function for the given SETBASE, providing the Object for each element within the set and optional parameters.
Parameters
-
#function IteratorFunction: The function that will be called. -
arg: -
Set: -
Function: -
FunctionArguments:
Return value
#SET_BASE: self
-
- SET_BASE:Get(ObjectName)
-
Gets a Core.Base#BASE object from the Core.Set#SET_BASE and derived classes, based on the Object Name.
Parameter
-
#string ObjectName:
Return value
-
- SET_BASE:GetSet()
-
Gets the Set.
Return value
#SET_BASE: self
- SET_BASE:IsIncludeObject(Object)
-
Decides whether to include the Object
Parameter
-
#table Object:
Return value
#SET_BASE: self
-
- #table SET_BASE.List
- SET_BASE:New(Database)
-
Creates a new SET_BASE object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.
Parameter
-
Database:
Return value
Usage:
-- Define a new SET_BASE Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE. DBObject = SET_BASE:New() -
- SET_BASE:Remove(ObjectName)
-
Removes a Core.Base#BASE object from the Core.Set#SET_BASE and derived classes, based on the Object Name.
Parameter
-
#string ObjectName:
-
- #table SET_BASE.Set
- SET_BASE:SetDatabase(BaseSet)
-
Copies the Filter criteria from a given Set (for rebuilding a new Set based on an existing Set).
Parameter
-
#SET_BASE BaseSet:
Return value
-
- SET_BASE:SetIteratorIntervals(YieldInterval, TimeInterval)
-
Define the SET iterator "yield interval" and the "time interval".
Parameters
-
#number YieldInterval: Sets the frequency when the iterator loop will yield after the number of objects processed. The default frequency is 10 objects processed. -
#number TimeInterval: Sets the time in seconds when the main logic will resume the iterator loop. The default time is 0.001 seconds.
Return value
#SET_BASE: self
-
- SET_BASE:_EventOnBirth(Event)
-
Handles the OnBirth event for the Set.
Parameter
-
Core.Event#EVENTDATA Event:
-
- SET_BASE:_EventOnDeadOrCrash(Event)
-
Handles the OnDead or OnCrash event for alive units set.
Parameter
-
Core.Event#EVENTDATA Event:
-
- SET_BASE:_EventOnPlayerEnterUnit(Event)
-
Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
Parameter
-
Core.Event#EVENTDATA Event:
-
- SET_BASE:_EventOnPlayerLeaveUnit(Event)
-
Handles the OnPlayerLeaveUnit event to clean the active players table.
Parameter
-
Core.Event#EVENTDATA Event:
-
- SET_BASE:_FilterStart()
-
Starts the filtering for the defined collection.
Return value
#SET_BASE: self
- SET_BASE:_Find(ObjectName)
-
Finds an Core.Base#BASE object based on the object Name.
Parameter
-
#string ObjectName:
Return value
Core.Base#BASE: The Object found.
-
Type SET_CLIENT
SET_CLIENT class
Field(s)
- SET_CLIENT:AddClientsByName(AddClientNames)
-
Add CLIENT(s) to SET_CLIENT.
Parameter
-
#string AddClientNames: A single name or an array of CLIENT names.
Return value
self
-
- SET_CLIENT: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 SETBASE birth event!
Parameter
-
Core.Event#EVENTDATA Event:
Return values
-
#string: The name of the CLIENT
-
#table: The CLIENT
-
- #string SET_CLIENT.ClassName
- SET_CLIENT:FilterCategories(Categories)
-
Builds a set of clients 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
#SET_CLIENT: self
-
- SET_CLIENT:FilterCoalitions(Coalitions)
-
Builds a set of clients of coalitions.
Possible current coalitions are red, blue and neutral.
Parameter
-
#string Coalitions: Can take the following values: "red", "blue", "neutral".
Return value
#SET_CLIENT: self
-
- SET_CLIENT:FilterCountries(Countries)
-
Builds a set of clients 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
#SET_CLIENT: self
-
- SET_CLIENT:FilterPrefixes(Prefixes)
-
Builds a set of clients of defined client prefixes.
All the clients starting with the given prefixes will be included within the set.
Parameter
-
#string Prefixes: The prefix of which the client name starts with.
Return value
#SET_CLIENT: self
-
- SET_CLIENT:FilterStart()
-
Starts the filtering.
Return value
#SET_CLIENT: self
- SET_CLIENT:FilterTypes(Types)
-
Builds a set of clients of defined client types.
Possible current types are those types known within DCS world.
Parameter
-
#string Types: Can take those type strings known within DCS world.
Return value
#SET_CLIENT: self
-
- SET_CLIENT:FindClient(ClientName)
-
Finds a Client based on the Client Name.
Parameter
-
#string ClientName:
Return value
Wrapper.Client#CLIENT: The found Client.
-
- SET_CLIENT: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 SETBASE event or vise versa!
Parameter
-
Core.Event#EVENTDATA Event:
Return values
-
#string: The name of the CLIENT
-
#table: The CLIENT
-
- SET_CLIENT:ForEachClient(IteratorFunction, ...)
-
Iterate the SET_CLIENT and call an interator function for each alive CLIENT, providing the CLIENT and optional parameters.
Parameters
-
#function IteratorFunction: The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter. -
...:
Return value
#SET_CLIENT: self
-
- SET_CLIENT:ForEachClientInZone(ZoneObject, IteratorFunction, ...)
-
Iterate the SET_CLIENT and call an iterator function for each alive CLIENT presence completely in a Zone, providing the CLIENT and optional parameters to the called function.
Parameters
-
Core.Zone#ZONE ZoneObject: The Zone to be tested for. -
#function IteratorFunction: The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter. -
...:
Return value
#SET_CLIENT: self
-
- SET_CLIENT:ForEachClientNotInZone(ZoneObject, IteratorFunction, ...)
-
Iterate the SET_CLIENT and call an iterator function for each alive CLIENT presence not in a Zone, providing the CLIENT and optional parameters to the called function.
Parameters
-
Core.Zone#ZONE ZoneObject: The Zone to be tested for. -
#function IteratorFunction: The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter. -
...:
Return value
#SET_CLIENT: self
-
- SET_CLIENT:IsIncludeObject(MClient)
-
Parameter
-
Wrapper.Client#CLIENT MClient:
Return value
#SET_CLIENT: self
-
- SET_CLIENT:New()
-
Creates a new SET_CLIENT object, building a set of clients belonging to a coalitions, categories, countries, types or with defined prefix names.
Return value
Usage:
-- Define a new SET_CLIENT Object. This DBObject will contain a reference to all Clients. DBObject = SET_CLIENT:New()
- SET_CLIENT:RemoveClientsByName(RemoveClientNames)
-
Remove CLIENT(s) from SET_CLIENT.
Parameter
-
Wrapper.Client#CLIENT RemoveClientNames: A single name or an array of CLIENT names.
Return value
self
-
Type SET_GROUP
SET_GROUP class
Field(s)
- SET_GROUP:AddGroupsByName(AddGroupNames)
-
Add GROUP(s) to SET_GROUP.
Parameter
-
#string AddGroupNames: A single name or an array of GROUP names.
Return value
self
-
- SET_GROUP: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 SETBASE birth event!
Parameter
-
Core.Event#EVENTDATA Event:
Return values
-
#string: The name of the GROUP
-
#table: The GROUP
-
- #string SET_GROUP.ClassName
- SET_GROUP: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
#SET_GROUP: self
-
- SET_GROUP: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
#SET_GROUP: self
-
- SET_GROUP: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
#SET_GROUP: self
-
- SET_GROUP: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
#SET_GROUP: self
-
- SET_GROUP:FilterStart()
-
Starts the filtering.
Return value
#SET_GROUP: self
- SET_GROUP:FindGroup(GroupName)
-
Finds a Group based on the Group Name.
Parameter
-
#string GroupName:
Return value
Wrapper.Group#GROUP: The found Group.
-
- SET_GROUP: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 SETBASE event or vise versa!
Parameter
-
Core.Event#EVENTDATA Event:
Return values
-
#string: The name of the GROUP
-
#table: The GROUP
-
- SET_GROUP:ForEachGroup(IteratorFunction, ...)
-
Iterate the SET_GROUP 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 SET_GROUP. The function needs to accept a GROUP parameter. -
...:
Return value
#SET_GROUP: self
-
- SET_GROUP:ForEachGroupCompletelyInZone(ZoneObject, IteratorFunction, ...)
-
Iterate the SET_GROUP and call an iterator function for each alive GROUP presence completely in a Zone, providing the GROUP and optional parameters to the called function.
Parameters
-
Core.Zone#ZONE ZoneObject: The Zone to be tested for. -
#function IteratorFunction: The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter. -
...:
Return value
#SET_GROUP: self
-
- SET_GROUP:ForEachGroupNotInZone(ZoneObject, IteratorFunction, ...)
-
Iterate the SET_GROUP and call an iterator function for each alive GROUP presence not in a Zone, providing the GROUP and optional parameters to the called function.
Parameters
-
Core.Zone#ZONE ZoneObject: The Zone to be tested for. -
#function IteratorFunction: The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter. -
...:
Return value
#SET_GROUP: self
-
- SET_GROUP:ForEachGroupPartlyInZone(ZoneObject, IteratorFunction, ...)
-
Iterate the SET_GROUP and call an iterator function for each alive GROUP presence partly in a Zone, providing the GROUP and optional parameters to the called function.
Parameters
-
Core.Zone#ZONE ZoneObject: The Zone to be tested for. -
#function IteratorFunction: The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter. -
...:
Return value
#SET_GROUP: self
-
- SET_GROUP:IsIncludeObject(MooseGroup)
-
Parameter
-
Wrapper.Group#GROUP MooseGroup:
Return value
#SET_GROUP: self
-
- SET_GROUP:New()
-
Creates a new SET_GROUP object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.
Return value
Usage:
-- Define a new SET_GROUP Object. This DBObject will contain a reference to all alive GROUPS. DBObject = SET_GROUP:New()
- SET_GROUP:RemoveGroupsByName(RemoveGroupNames)
-
Remove GROUP(s) from SET_GROUP.
Parameter
-
Wrapper.Group#GROUP RemoveGroupNames: A single name or an array of GROUP names.
Return value
self
-
Type SET_UNIT
SET_UNIT class
Field(s)
- SET_UNIT: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 SETBASE birth event!
Parameter
-
Core.Event#EVENTDATA Event:
Return values
-
#string: The name of the UNIT
-
#table: The UNIT
-
- SET_UNIT:AddUnit(AddUnit)
-
Add UNIT(s) to SET_UNIT.
Parameter
-
#string AddUnit: A single UNIT.
Return value
#SET_UNIT: self
-
- SET_UNIT:AddUnitsByName(AddUnitNames)
-
Add UNIT(s) to SET_UNIT.
Parameter
-
#string AddUnitNames: A single name or an array of UNIT names.
Return value
#SET_UNIT: self
-
- SET_UNIT:CalculateThreatLevelA2G()
-
Calculate the maxium A2G threat level of the SET_UNIT.
- #string SET_UNIT.ClassName
- SET_UNIT:FilterCategories(Categories)
-
Builds a set of units 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
#SET_UNIT: self
-
- SET_UNIT:FilterCoalitions(Coalitions)
-
Builds a set of units of coalitions.
Possible current coalitions are red, blue and neutral.
Parameter
-
#string Coalitions: Can take the following values: "red", "blue", "neutral".
Return value
#SET_UNIT: self
-
- SET_UNIT:FilterCountries(Countries)
-
Builds a set of units 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
#SET_UNIT: self
-
- SET_UNIT:FilterHasRadar(RadarTypes)
-
Builds a set of units having a radar of give types.
All the units having a radar of a given type will be included within the set.
Parameter
-
#table RadarTypes: The radar types.
Return value
#SET_UNIT: self
-
- SET_UNIT:FilterHasSEAD()
-
Builds a set of SEADable units.
Return value
#SET_UNIT: self
- SET_UNIT:FilterPrefixes(Prefixes)
-
Builds a set of units of defined unit prefixes.
All the units starting with the given prefixes will be included within the set.
Parameter
-
#string Prefixes: The prefix of which the unit name starts with.
Return value
#SET_UNIT: self
-
- SET_UNIT:FilterStart()
-
Starts the filtering.
Return value
#SET_UNIT: self
- SET_UNIT:FilterTypes(Types)
-
Builds a set of units of defined unit types.
Possible current types are those types known within DCS world.
Parameter
-
#string Types: Can take those type strings known within DCS world.
Return value
#SET_UNIT: self
-
- SET_UNIT: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 SETBASE event or vise versa!
Parameter
-
Core.Event#EVENTDATA Event:
Return values
-
#string: The name of the UNIT
-
#table: The UNIT
-
- SET_UNIT:FindUnit(UnitName)
-
Finds a Unit based on the Unit Name.
Parameter
-
#string UnitName:
Return value
Wrapper.Unit#UNIT: The found Unit.
-
- SET_UNIT:ForEachUnit(IteratorFunction, ...)
-
Iterate the SET_UNIT and call an interator 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 SET_UNIT. The function needs to accept a UNIT parameter. -
...:
Return value
#SET_UNIT: self
-
- SET_UNIT:ForEachUnitCompletelyInZone(ZoneObject, IteratorFunction, ...)
-
Iterate the SET_UNIT and call an iterator function for each alive UNIT presence completely in a Zone, providing the UNIT and optional parameters to the called function.
Parameters
-
Core.Zone#ZONE ZoneObject: The Zone to be tested for. -
#function IteratorFunction: The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter. -
...:
Return value
#SET_UNIT: self
-
- SET_UNIT:ForEachUnitNotInZone(ZoneObject, IteratorFunction, ...)
-
Iterate the SET_UNIT and call an iterator function for each alive UNIT presence not in a Zone, providing the UNIT and optional parameters to the called function.
Parameters
-
Core.Zone#ZONE ZoneObject: The Zone to be tested for. -
#function IteratorFunction: The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter. -
...:
Return value
#SET_UNIT: self
-
- SET_UNIT:GetUnitThreatLevels()
-
Returns map of unit threat levels.
Return value
#table:
- SET_UNIT:GetUnitTypes()
-
Returns map of unit types.
Return value
#map:
string,#number> A map of the unit types found. The key is the UnitTypeName and the value is the amount of unit types found.
- SET_UNIT:GetUnitTypesText()
-
Returns a comma separated string of the unit types with a count in the Set.
Return value
#string: The unit types string
- SET_UNIT:HasFriendlyUnits(FriendlyCoalition)
-
Returns if the Set has friendly ground units.
Parameter
-
FriendlyCoalition:
Return value
#number: The amount of ground targets in the Set.
-
- SET_UNIT:HasGroundUnits()
-
Returns if the Set has ground targets.
Return value
#number: The amount of ground targets in the Set.
- SET_UNIT:HasRadar(RadarType)
-
Returns if the Set has targets having a radar (of a given type).
Parameter
-
Dcs.DCSWrapper.Unit#Unit.RadarType RadarType:
Return value
#number: The amount of radars in the Set with the given type
-
- SET_UNIT:HasSEAD()
-
Returns if the Set has targets that can be SEADed.
Return value
#number: The amount of SEADable units in the Set
- SET_UNIT:IsIncludeObject(MUnit)
-
Parameter
-
Wrapper.Unit#UNIT MUnit:
Return value
#SET_UNIT: self
-
- SET_UNIT:New()
-
Creates a new SET_UNIT object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.
Return value
Usage:
-- Define a new SET_UNIT Object. This DBObject will contain a reference to all alive Units. DBObject = SET_UNIT:New()
- SET_UNIT:RemoveUnitsByName(RemoveUnitNames)
-
Remove UNIT(s) from SET_UNIT.
Parameter
-
Wrapper.Unit#UNIT RemoveUnitNames: A single name or an array of UNIT names.
Return value
self
-