BIS fnc uniqueClasses: Difference between revisions

From Bohemia Interactive Community
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Fix example)
 
(32 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{RV|type=function
|game1= arma3
|version1= 1.00


{{Function|= Comments
|gr1= Configs
____________________________________________________________________________________________


| arma3 |= Game name
|descr= Composes an array of classes with unique param (based on returned value of passed code). If class inherits the param from parent, it's not listed.


|1.00|= Game version
|s1= [config, code] call [[BIS_fnc_uniqueClasses]]
____________________________________________________________________________________________
|p1= config: [[Config]] - class which is searched
|p2= code: [[Code]] - code executed on class, which is passed as <sqf inline>_this</sqf> or <sqf inline>_x</sqf>


| <pre>/*
|r1= [[Array]] of classes with unique param in format [<nowiki/>[config, value], ...] where:
* config: [[Config]] - config which defines the parameter value
* value: [[Anything]] - value returned by the specified {{hl|code}} parameter


Description:
|x1= <sqf>_aiClassTypes = [configFile >> "CfgVehicles", { getText (_this >> "aiBrainType") }] call BIS_fnc_uniqueClasses;</sqf>
Composes array of classes with unique param (based on returned value of passed code).
If class inherits the param from parent, it's not listed.
Parameter(s):
0: CONFIG - class which is searched
1: CODE - code executed on class, which is passed as _this
Returns:
ARRAY - classes in format [class,value]
class: CONFIG - class with unique param
value: ANY - value returned by the passed code for the given class
*/
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
 
| <!-- [] call [[BIS_fnc_uniqueClasses]]; --> |= Syntax
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[BIS_fnc_returnChildren]] [[BIS_fnc_returnParents]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Configs|{{uc:uniqueClasses}}]]
[[Category:Functions|{{uc:uniqueClasses}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:uniqueClasses}}]]

Latest revision as of 23:38, 24 June 2025

Hover & click on the images for description

Description

Description:
Composes an array of classes with unique param (based on returned value of passed code). If class inherits the param from parent, it's not listed.
Execution:
call
Groups:
Configs

Syntax

Syntax:
[config, code] call BIS_fnc_uniqueClasses
Parameters:
config: Config - class which is searched
code: Code - code executed on class, which is passed as _this or _x
Return Value:
Array of classes with unique param in format [[config, value], ...] where:
  • config: Config - config which defines the parameter value
  • value: Anything - value returned by the specified code parameter

Examples

Example 1:
_aiClassTypes = [configFile >> "CfgVehicles", { getText (_this >> "aiBrainType") }] call BIS_fnc_uniqueClasses;

Additional Information

See also:
BIS_fnc_returnChildren BIS_fnc_returnParents

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note