52 proto native external
typename Type();
139 proto
volatile int Call(
Class inst,
string function,
void parm);
222 static proto
int SetVar(out
void var,
string value);
230 static proto
void Watch(
void var,
int flags);
253proto
void Sort(
void param_array[],
int num);
389 proto
void Set(
int n, T value);
451 int nFrom = from.Count();
452 for (
int i = 0; i < nFrom; ++i )
493 proto native
void Sort(
bool reverse =
false);
504 int remove_index =
Find(value);
506 if ( remove_index >= 0 )
514 int remove_index =
Find(value);
516 if ( remove_index >= 0 )
524 return ( index > -1 && index <
Count() );
550 Print(
string.Format(
"Array count: %1",
Count()));
551 for (
int i = 0; i <
Count(); i++)
554 Print(
string.Format(
"[%1] => %2", i, item));
593 T item1 =
Get(item1_index);
594 Set(item1_index,
Get(item2_index));
595 Set(item2_index, item1);
600 int nOther = other.Count();
601 for (
int i = 0; i < nOther; ++i)
603 T item = other.Get(i);
611 int right =
Count() - 1;
639 int new_index = curr_index;
641 if ( move_number > 0 )
643 new_index = curr_index + move_number;
646 if ( move_number < 0 )
648 new_index = curr_index - move_number;
652 if ( new_index <= -count )
654 new_index = (new_index % count);
657 new_index = new_index + count;
661 if ( new_index >= count )
663 new_index = (new_index % count);
672 for (
int i = 0; i <
Count(); i++)
692 if (
Count() != pOtherArray.Count())
694 ErrorEx(
"arrays are not the same size");
698 int nOther = pOtherArray.Count();
699 for (
int i = 0; i < nOther; ++i)
701 if (
Get(i) != pOtherArray.Get(i))
758 proto native
void Swap(set<T> other);
763 int count = other.Count();
764 for (
int i = 0; i < count; i++)
773 int remove_index =
Find(value);
774 if (remove_index >= 0)
782 int count = other.Count();
783 for (
int i = 0; i < count; i++)
792 Print(
string.Format(
"Set count: %1",
Count()));
793 for (
int i = 0; i <
Count(); i++)
796 Print(
string.Format(
"[%1] => %2", i, item));
847 proto TValue
Get(TKey key);
858 proto
bool Find(TKey key, out TValue val);
883 proto
void Set(TKey key, TValue value);
907 proto
bool Insert(TKey key, TValue value);
913 for (
int i = 0; i <
Count(); ++i)
922 for (
int i = 0; i <
Count(); ++i)
932 Set(new_key,
Get(old_key));
942 for (
int i = 0; i <
Count(); i++)
956 for (
int i = 0; i <
Count(); i++)
void Remove(Object object)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Super root of all classes in Enforce script.
Module containing compiled scripts.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DisplayElementBase GetElement(eDisplayElements element_id)
proto void Print(void var)
Prints content of variable to console/log.
proto int ParseString(string input, out string tokens[])
Parses string into array of tokens returns number of tokens.
proto native void Reserve(int newSize)
Resizes the array to given size internally.
map< Managed, int > TManagedIntMap
map< Managed, Class > TManagedClassMap
proto volatile int CallFunction(Class inst, string function, out void returnVal, void parm)
dynamic call of function when inst == NULL, it's global function call, otherwise it's method of class...
void SwapItems(int item1_index, int item2_index)
map< typename, float > TTypeNameFloatMap
static proto void Watch(void var, int flags)
Debug tool for watching certain variable.
proto int ParseStringEx(inout string input, string token)
Parses one token from input string.
void InsertSet(set< T > other)
proto void Sort(void param_array[], int num)
Sorts static array of integers(ascendically) / floats(ascendically) / strings(alphabetically).
array< typename > TTypenameArray
TKey GetKeyByValue(TValue value)
proto void Remove(TKey key)
Removes element with given key.
proto TKey GetKey(int i)
Return the i:th element key in the map.
array< float > TFloatArray
proto void RemoveElement(int i)
Removes i:th element with given key.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
proto int Find(T value)
Tries to find the first occurance of given value in the array.
proto void Set(int n, T value)
Sets n-th element to given value.
map< Class, vector > TClassVectorMap
proto int Insert(T value)
Inserts element at the end of array.
proto int Copy(set< T > from)
void RemoveItemUnOrdered(T value)
map< Class, typename > TClassTypenameMap
proto native external bool IsInherited(typename type)
Returns true when instance is of the type, or inherited one.
array< TKey > GetKeyArray()
static proto bool SafeCastType(Class type, out Class to, Class from)
This function is for internal script usage.
map< ref Managed, Managed > TManagedRefManagedMap
array< string > TStringArray
static proto Class Cast(Class from)
Try to safely down-cast base class to child class.
proto native void RemoveOrdered(int index)
Removes element from array, but retain all elements ordered.
map< int, Class > TIntClassMap
map< Class, float > TClassFloatMap
map< string, vector > TStringVectorMap
proto native int KillThread(Class owner, string name)
Kills thread.
map< int, string > TIntStringMap
proto native void Swap(notnull array< T > other)
Swaps the contents of this and other arrays.
map< int, float > TIntFloatMap
proto native int Count()
O(1) complexity.
proto owned string ThreadFunction(Class owner, string name, int backtrace, out int linenumber)
Debug function.
bool IsValidIndex(int index)
proto int Copy(map< TKey, TValue > from)
proto native MapIterator Begin()
array< Managed > TManagedArray
map< ref Managed, vector > TManagedRefVectorMap
proto native void Swap(set< T > other)
int DifferentAtPosition(array< T > pOtherArray)
Returns an index where 2 arrays start to differ from each other.
proto static external StaticType()
Returns typename of object's reference.
map< ref Managed, float > TManagedRefFloatMap
void InsertArray(array< T > other)
array< vector > TVectorArray
array< ref Managed > TManagedRefArray
map< ref Managed, ref Managed > TManagedRefManagedRefMap
proto TKey GetIteratorKey(MapIterator it)
proto native MapIterator Next(MapIterator it)
proto int Copy(notnull array< T > from)
Copes contents of from array to this array.
map< Class, Class > TClassClassMap
proto native void Sort(bool reverse=false)
Sorts elements of array, depends on underlaying type.
proto native MapIterator End()
proto native void Release()
array< Class > TClassArray
map< Class, int > TClassIntMap
proto int InsertAt(T value, int index)
Inserts element at certain position and moves all elements behind this position by one.
proto void copyarray(void destArray, void srcArray)
static proto int SetVar(out void var, string value)
Sets variable value by value in string.
T GetRandomElement()
Returns a random element of array.
static StaticGetType(typename t)
Returns typename of class even without a variable or instance.
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
map< ref Managed, typename > TManagedRefTypenameMap
map< Managed, typename > TManagedTypenameMap
map< string, int > TStringIntMap
proto volatile void Idle()
Yiels execution to other threads and then it continues.
set< ref Managed > TManagedRefSet
proto native void Clear()
Destroyes all elements of the array and sets the Count to 0.
proto TValue Get(TKey key)
Search for an element with the given key.
proto TValue GetElement(int index)
Return the i:th element in the map.
map< typename, vector > TTypeNameVectorMap
void Obsolete(string msg="")
proto native void Resize(int newSize)
Resizes the array to given size.
map< ref Managed, string > TManagedRefStringMap
map< int, typename > TIntTypenameMap
map< Class, ref Managed > TClassManagedRefMap
map< Managed, Managed > TManagedManagedMap
void RemoveItems(set< T > other)
proto void Set(TKey key, TValue value)
Sets value of element with given key.
static proto int GetClassVar(Class inst, string varname, int index, out void result)
Dynamic read of variable value by its name.
map< typename, Managed > TTypeNameManagedMap
static proto native ScriptModule LoadScript(ScriptModule parentModule, string scriptFile, bool listing)
Do load script and create ScriptModule for it.
proto void reversearray(void param_array)
map< Managed, ref Managed > TManagedManagedRefMap
map< string, ref Managed > TStringManagedRefMap
map< typename, ref Managed > TTypeNameManagedRefMap
map< typename, int > TTypeNameIntMap
map< string, string > TStringStringMap
map< Class, string > TClassStringMap
map< int, int > TIntIntMap
bool ReplaceKey(TKey old_key, TKey new_key)
map< string, float > TStringFloatMap
map< ref Managed, int > TManagedRefIntMap
proto volatile int Call(Class inst, string function, void parm)
dynamic call of function when inst == NULL, it's global function call, otherwise it's method of class...
proto native void Remove(int index)
Removes element from array.
map< typename, Class > TTypeNameClassMap
int MoveIndex(int curr_index, int move_number)
Returns a index in array moved by specific number.
void InsertAll(notnull array< T > from)
Inserts all elements from array.
array< TValue > GetValueArray()
map< string, Class > TStringClassMap
int[] TypeID
script representation for C++ RTTI types
proto native owned external string ClassName()
Returns name of class-type.
set< typename > TTypenameSet
bool GetKeyByValueChecked(TValue value, out TKey key)
map< typename, string > TTypeNameStringMap
map< int, Managed > TIntManagedMap
proto external string ToString()
map< string, typename > TStringTypenameMap
static proto int SetClassVar(Class inst, string varname, int index, void input)
Dynamic write to variable by its name.
proto TValue GetIteratorElement(MapIterator it)
map< Managed, float > TManagedFloatMap
void Debug()
Print all elements in array.
proto bool Insert(TKey key, TValue value)
Insert new element into hash map.
int GetRandomIndex()
Returns a random index of array.
proto bool Find(TKey key, out TValue val)
Search for an element with the given key.
proto native external Type()
Returns typename of object's class.
class array< Class T > PrintString
proto bool Contains(TKey key)
Returns if map contains element with given key.
map< int, vector > TIntVectorMap
set< Managed > TManagedSet
map< int, ref Managed > TIntManagedRefMap
map< typename, typename > TTypeNameTypenameMap
map< ref Managed, Class > TManagedRefClassMap
map< Managed, string > TManagedStringMap
map< Managed, vector > TManagedVectorMap
proto volatile int CallFunctionParams(Class inst, string function, out void returnVal, Class parms)
map< string, Managed > TStringManagedMap
map< Class, Managed > TClassManagedMap
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
enum MagnumStableStateID init
void Set(T value, string system="")