diff options
| author | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
| commit | 5e2eb7d67ae933b7566f1944d0bb7744da03d586 (patch) | |
| tree | 054acff1113270a9cd07933df760f3768c1b6853 /sourcemod/scripting/include/GlobalAPI/iterable.inc | |
| parent | 341db13a008dc12bb22ceb50452d93d01476308c (diff) | |
move source stuff to its own folder
Diffstat (limited to 'sourcemod/scripting/include/GlobalAPI/iterable.inc')
| -rw-r--r-- | sourcemod/scripting/include/GlobalAPI/iterable.inc | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/sourcemod/scripting/include/GlobalAPI/iterable.inc b/sourcemod/scripting/include/GlobalAPI/iterable.inc deleted file mode 100644 index 585873b..0000000 --- a/sourcemod/scripting/include/GlobalAPI/iterable.inc +++ /dev/null @@ -1,55 +0,0 @@ -// ================== DOUBLE INCLUDE ========================= // - -#if defined _GlobalAPI_Iterable_included_ -#endinput -#endif -#define _GlobalAPI_Iterable_included_ - -// =========================================================== // - -#include <json> - -// =========================================================== // - -/* - Helper methodmap for JSON_Object arrays -*/ -methodmap APIIterable < JSON_Object -{ - /** - * Creates a new APIIterable - * - * @param hItems JSON_Object array handle - * @return A new APIIterable handle - */ - public APIIterable(JSON_Object hItems) - { - if (hItems.HasKey("result")) - { - return view_as<APIIterable>(hItems.GetObject("result")); - } - return view_as<APIIterable>(hItems); - } - - /* - Gets count of the items in the array - */ - property int Count - { - public get() { return this.Length; } - } - - /** - * Gets an object from the array by index - * - * @note This is an alias to GetObjectIndexed - * @param index Index of the object we want to retrieve - * @return JSON_Object handle to the object retrieved - */ - public JSON_Object GetById(int index) - { - return this.GetObjectIndexed(index); - } -} - -// =========================================================== //
\ No newline at end of file |
