A few sdktools functions now accept all entities and the Player versions are deprecated
3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is part of the SourceMod/SourcePawn SDK. This file may only be used
8 * or modified under the Terms and Conditions of its License Agreement, which is found
9 * in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
10 * may change at any time. To view the latest information, see:
11 * http://www.sourcemod.net/license.php
17 #if defined _sorting_included
20 #define _sorting_included
23 * Contains sorting orders.
27 Sort_Ascending = 0, /**< Ascending order */
28 Sort_Descending = 1, /**< Descending order */
32 * Sorts an array of integers.
34 * @param array Array of integers to sort in-place.
35 * @param array_size Size of the array.
36 * @param order Sorting order to use.
39 native SortIntegers(array[], array_size, SortOrder:order = Sort_Ascending);
42 * Sorts an array of float point numbers.
44 * @param array Array of floating point numbers to sort in-place.
45 * @param array_size Size of the array.
46 * @param order Sorting order to use.
49 native SortFloats(Float:array[], array_size, SortOrder:order = Sort_Ascending);
52 * Sorts an array of strings.
54 * @param array Array of strings to sort in-place.
55 * @param array_size Size of the array.
56 * @param order Sorting order to use.
59 native SortStrings(String:array[][], num_strings, SortOrder:order = Sort_Ascending);
62 * Sort comparison function for 1D array elements.
63 * @note You may need to use explicit tags in order to use data properly.
65 * @param elem1 First element to compare.
66 * @param elem2 Second element to compare.
67 * @param array Array that is being sorted (order is undefined).
68 * @param hndl Handle optionally passed in while sorting.
69 * @return -1 if first should go before second
70 * 0 if first is equal to second
71 * 1 if first should go after second
73 functag SortFunc1D public(elem1, elem2, const array[], Handle:hndl);
76 * Sorts a custom 1D array. You must pass in a comparison function.
78 * @param array Array to sort.
79 * @param array_size Size of the array to sort.
80 * @param sortfunc Sort function.
81 * @param hndl Optional Handle to pass through the comparison calls.
84 native SortCustom1D(array[], array_size, SortFunc1D:sortfunc, Handle:hndl=INVALID_HANDLE);
87 * Sort comparison function for 2D array elements (sub-arrays).
88 * @note You may need to use explicit tags in order to use data properly.
90 * @param elem1 First array to compare.
91 * @param elem2 Second array to compare.
92 * @param array Array that is being sorted (order is undefined).
93 * @param hndl Handle optionally passed in while sorting.
94 * @return -1 if first should go before second
95 * 0 if first is equal to second
96 * 1 if first should go after second
100 public(array[], array[], const array[][], Handle:hndl),
101 public(String:array[], String:array[], const String:array[][], Handle:hndl),
105 * Sorts a custom 2D array. You must pass in a comparison function.
107 * @param array Array to sort.
108 * @param array_size Size of the major array to sort (first index, outermost).
109 * @param sortfunc Sort comparison function to use.
110 * @param hndl Optional Handle to pass through the comparison calls.
113 native SortCustom2D(array[][], array_size, SortFunc2D:sortfunc, Handle:hndl=INVALID_HANDLE);