Fandom

武装突袭 Wiki

BIS_fnc_sortBy

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

Introduced with Arma 3 version 0.58
  

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
0.58

Description

Description:

/*

	Description:
	Sorts an array according to given algorithm.

	Parameter(s):
	_this select 0: any unsorted array (Array)
		- array can contain any types (object/numbers/strings ..)

	_this select 1: input parameters (Array)
		- used in the eval algorithm (object/numbers/strings ..)
		- input params are referenced in the sorting algorithm by _input0, _input1 .. _input9
		- max. number of 10 input params is supported (0-9)

	_this select 2: sorted algorithm (Code) [optional: default {_x}]
		- code needs to return a scalar
		- variable _x refers to array item

	_this select 3: sort direction (String) [optional: default "ASCEND"]
		"ASCEND": sorts array in ascending direction (from lowest value to highest)
		"DESCEND": sorts array in descending direction

	_this select 4: filter (Code) [optional: default {true}]
		- code that needs to evaluate true for the array item to be sorted, otherwise item is removed

	Returns:
	Array

	Examples:

	//sort numbers from lowest to highest
	_sortedNumbers = [[1,-80,0,480,15,-40],[],{_x},"ASCEND"] call BIS_fnc_sortBy;

	//sort helicopters by distance from player
	_closestHelicopters = [[_heli1,_heli2,_heli3],[],{player distance _x},"ASCEND"] call BIS_fnc_sortBy;

	//sort enemy by distance from friendly unit (referenced by local variable), the furtherest first
	_furtherstEnemy = [[_enemy1,_enemy2,_enemy3],[_friendly],{_input0 distance _x},"DESCEND",{canMove _x}] call BIS_fnc_sortBy;
*/

(Placeholder description extracted from the function header by BIS_fnc_exportFunctionsToWiki)

Example 1:</dt>
Example needed</dd>
See also:</dt>

BIS_fnc_sortAlphabeticallyBIS_fnc_sortNumsort</dd>

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section

更多维基

随机维基