Updated includes and spcomp to SourceMod 1.9
This commit is contained in:
Vendored
+37
-35
@@ -9,7 +9,7 @@
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
||||
* Free Software Foundation.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
@@ -29,20 +29,20 @@
|
||||
*
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
|
||||
#if defined _adt_array_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _adt_array_included
|
||||
|
||||
/**
|
||||
* Given a maximum string size (including the null terminator),
|
||||
* Given a maximum string size (including the null terminator),
|
||||
* returns the number of cells required to fit that string.
|
||||
*
|
||||
* @param size Number of bytes.
|
||||
* @return Minimum number of cells required to fit the byte count.
|
||||
*/
|
||||
stock ByteCountToCells(size)
|
||||
stock int ByteCountToCells(int size)
|
||||
{
|
||||
if (!size)
|
||||
return 1;
|
||||
@@ -52,17 +52,17 @@ stock ByteCountToCells(size)
|
||||
methodmap ArrayList < Handle {
|
||||
// Creates a dynamic global cell array. While slower than a normal array,
|
||||
// it can be used globally AND dynamically, which is otherwise impossible.
|
||||
//
|
||||
// The contents of the array are uniform; i.e. storing a string at index X
|
||||
//
|
||||
// The contents of the array are uniform; i.e. storing a string at index X
|
||||
// and then retrieving it as an integer is NOT the same as StringToInt()!
|
||||
// The "blocksize" determines how many cells each array slot has; it cannot
|
||||
// be changed after creation.
|
||||
//
|
||||
// @param blocksize The number of cells each member of the array can
|
||||
// @param blocksize The number of cells each member of the array can
|
||||
// hold. For example, 32 cells is equivalent to:
|
||||
// new Array[X][32]
|
||||
// @param startsize Initial size of the array. Note that data will
|
||||
// NOT be auto-intialized.
|
||||
// @param startsize Initial size of the array. Note that data will
|
||||
// NOT be auto-initialized.
|
||||
// @return New Handle to the array object.
|
||||
public native ArrayList(int blocksize=1, int startsize=0);
|
||||
|
||||
@@ -106,7 +106,7 @@ methodmap ArrayList < Handle {
|
||||
//
|
||||
// @param values Block of values to copy.
|
||||
// @param size If not set, the number of elements copied from the array
|
||||
// will be equal to the blocksize. If set higher than the
|
||||
// will be equal to the blocksize. If set higher than the
|
||||
// blocksize, the operation will be truncated.
|
||||
// @return Index of the new entry.
|
||||
public native int PushArray(const any[] values, int size=-1);
|
||||
@@ -128,7 +128,7 @@ methodmap ArrayList < Handle {
|
||||
// @param maxlength Maximum size of the buffer.
|
||||
// @return Number of characters copied.
|
||||
// @error Invalid index.
|
||||
public native int GetString(int index, char[] buffer, maxlength);
|
||||
public native int GetString(int index, char[] buffer, int maxlength);
|
||||
|
||||
// Retrieves an array of cells from an array.
|
||||
//
|
||||
@@ -168,15 +168,15 @@ methodmap ArrayList < Handle {
|
||||
// @error Invalid index.
|
||||
public native void SetArray(int index, const any[] values, int size=-1);
|
||||
|
||||
// Shifts an array up. All array contents after and including the given
|
||||
// index are shifted up by one, and the given index is then "free."
|
||||
// Shifts an array up. All array contents after and including the given
|
||||
// index are shifted up by one, and the given index is then "free."
|
||||
// After shifting, the contents of the given index is undefined.
|
||||
//
|
||||
// @param index Index in the array to shift up from.
|
||||
// @error Invalid index.
|
||||
public native void ShiftUp(int index);
|
||||
|
||||
// Removes an array index, shifting the entire array down from that position
|
||||
// Removes an array index, shifting the entire array down from that position
|
||||
// on. For example, if item 8 of 10 is removed, the last 3 items will then be
|
||||
// (6,7,8) instead of (7,8,9), and all indexes before 8 will remain unchanged.
|
||||
//
|
||||
@@ -191,19 +191,21 @@ methodmap ArrayList < Handle {
|
||||
// @error Invalid index.
|
||||
public native void SwapAt(int index1, int index2);
|
||||
|
||||
// Returns the index for the first occurance of the provided string. If
|
||||
// Returns the index for the first occurrence of the provided string. If
|
||||
// the string cannot be located, -1 will be returned.
|
||||
//
|
||||
// @param item String to search for
|
||||
// @return Array index, or -1 on failure
|
||||
public native int FindString(const char[] item);
|
||||
|
||||
// Returns the index for the first occurance of the provided value. If the
|
||||
|
||||
// Returns the index for the first occurrence of the provided value. If the
|
||||
// value cannot be located, -1 will be returned.
|
||||
//
|
||||
// @param item Value to search for
|
||||
// @param block Optionally which block to search in
|
||||
// @return Array index, or -1 on failure
|
||||
public native int FindValue(any item);
|
||||
// @error Invalid block index
|
||||
public native int FindValue(any item, int block=0);
|
||||
|
||||
// Retrieve the size of the array.
|
||||
property int Length {
|
||||
@@ -214,17 +216,17 @@ methodmap ArrayList < Handle {
|
||||
/**
|
||||
* Creates a dynamic global cell array. While slower than a normal array,
|
||||
* it can be used globally AND dynamically, which is otherwise impossible.
|
||||
*
|
||||
* The contents of the array are uniform; i.e. storing a string at index X
|
||||
*
|
||||
* The contents of the array are uniform; i.e. storing a string at index X
|
||||
* and then retrieving it as an integer is NOT the same as StringToInt()!
|
||||
* The "blocksize" determines how many cells each array slot has; it cannot
|
||||
* be changed after creation.
|
||||
*
|
||||
* @param blocksize The number of cells each member of the array can
|
||||
* @param blocksize The number of cells each member of the array can
|
||||
* hold. For example, 32 cells is equivalent to:
|
||||
* new Array[X][32]
|
||||
* @param startsize Initial size of the array. Note that data will
|
||||
* NOT be auto-intialized.
|
||||
* @param startsize Initial size of the array. Note that data will
|
||||
* NOT be auto-initialized.
|
||||
* @return New Handle to the array object.
|
||||
*/
|
||||
native ArrayList CreateArray(int blocksize=1, int startsize=0);
|
||||
@@ -254,10 +256,9 @@ native Handle CloneArray(Handle array);
|
||||
*
|
||||
* @param array Array Handle.
|
||||
* @param newsize New size.
|
||||
* @noreturn
|
||||
* @error Invalid Handle or out of memory.
|
||||
*/
|
||||
native bool ResizeArray(Handle array, int newsize);
|
||||
native void ResizeArray(Handle array, int newsize);
|
||||
|
||||
/**
|
||||
* Returns the array size.
|
||||
@@ -300,7 +301,7 @@ native int PushArrayString(Handle array, const char[] value);
|
||||
* @param array Array Handle.
|
||||
* @param values Block of values to copy.
|
||||
* @param size If not set, the number of elements copied from the array
|
||||
* will be equal to the blocksize. If set higher than the
|
||||
* will be equal to the blocksize. If set higher than the
|
||||
* blocksize, the operation will be truncated.
|
||||
* @return Index of the new entry.
|
||||
* @error Invalid Handle or out of memory.
|
||||
@@ -330,7 +331,7 @@ native any GetArrayCell(Handle array, int index, int block=0, bool asChar=false)
|
||||
* @return Number of characters copied.
|
||||
* @error Invalid Handle or invalid index.
|
||||
*/
|
||||
native int GetArrayString(Handle array, int index, char[] buffer, maxlength);
|
||||
native int GetArrayString(Handle array, int index, char[] buffer, int maxlength);
|
||||
|
||||
/**
|
||||
* Retrieves an array of cells from an array.
|
||||
@@ -383,8 +384,8 @@ native int SetArrayString(Handle array, int index, const char[] value);
|
||||
native int SetArrayArray(Handle array, int index, const any[] values, int size=-1);
|
||||
|
||||
/**
|
||||
* Shifts an array up. All array contents after and including the given
|
||||
* index are shifted up by one, and the given index is then "free."
|
||||
* Shifts an array up. All array contents after and including the given
|
||||
* index are shifted up by one, and the given index is then "free."
|
||||
* After shifting, the contents of the given index is undefined.
|
||||
*
|
||||
* @param array Array Handle.
|
||||
@@ -394,7 +395,7 @@ native int SetArrayArray(Handle array, int index, const any[] values, int size=-
|
||||
native void ShiftArrayUp(Handle array, int index);
|
||||
|
||||
/**
|
||||
* Removes an array index, shifting the entire array down from that position
|
||||
* Removes an array index, shifting the entire array down from that position
|
||||
* on. For example, if item 8 of 10 is removed, the last 3 items will then be
|
||||
* (6,7,8) instead of (7,8,9), and all indexes before 8 will remain unchanged.
|
||||
*
|
||||
@@ -415,7 +416,7 @@ native void RemoveFromArray(Handle array, int index);
|
||||
native void SwapArrayItems(Handle array, int index1, int index2);
|
||||
|
||||
/**
|
||||
* Returns the index for the first occurance of the provided string. If the string
|
||||
* Returns the index for the first occurrence of the provided string. If the string
|
||||
* cannot be located, -1 will be returned.
|
||||
*
|
||||
* @param array Array Handle.
|
||||
@@ -424,14 +425,15 @@ native void SwapArrayItems(Handle array, int index1, int index2);
|
||||
* @error Invalid Handle
|
||||
*/
|
||||
native int FindStringInArray(Handle array, const char[] item);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the index for the first occurance of the provided value. If the value
|
||||
* Returns the index for the first occurrence of the provided value. If the value
|
||||
* cannot be located, -1 will be returned.
|
||||
*
|
||||
* @param array Array Handle.
|
||||
* @param item Value to search for
|
||||
* @param block Optionally which block to search in
|
||||
* @return Array index, or -1 on failure
|
||||
* @error Invalid Handle
|
||||
* @error Invalid Handle or invalid block
|
||||
*/
|
||||
native int FindValueInArray(Handle array, any item);
|
||||
native int FindValueInArray(Handle array, any item, int block=0);
|
||||
|
||||
Reference in New Issue
Block a user