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);
252proto
void Sort(
void param_array[],
int num);
364 proto
void Set(
int n, T value);
426 for (
int i = 0; i < from.Count(); i++)
465 proto native
void Sort(
bool reverse =
false);
476 int remove_index = Find(value);
478 if (remove_index >= 0)
479 RemoveOrdered(remove_index);
484 int remove_index = Find(value);
486 if (remove_index >= 0)
492 return (index > -1 && index <
Count());
518 Print(
string.Format(
"Array count: %1",
Count()));
519 for (
int i = 0; i <
Count(); i++)
522 Print(
string.Format(
"[%1] => %2", i, item));
554 return Get(GetRandomIndex());
559 T item1 =
Get(item1_index);
560 Set(item1_index,
Get(item2_index));
561 Set(item2_index, item1);
566 for (
int i = 0; i < other.Count(); i++)
568 T item = other.Get(i);
576 int right =
Count() - 1;
582 Set(left++,
Get(right));
604 int new_index = curr_index;
607 new_index = curr_index + move_number;
611 new_index = curr_index - move_number;
615 if (new_index <= -count)
616 new_index = (new_index % count);
618 new_index = new_index + count;
622 if (new_index >= count)
623 new_index = (new_index % count);
631 for (
int i = 0; i <
Count(); i++)
632 SwapItems(i, GetRandomIndex());
649 if (
Count() != pOtherArray.Count())
651 ErrorEx(
"arrays are not the same size");
655 for (
int i = 0; i < pOtherArray.Count(); ++i)
657 if (
Get(i) != pOtherArray.Get(i))
712 proto native
void Swap(set<T> other);
717 int count = other.Count();
718 for (
int i = 0; i < count; i++)
727 int remove_index = Find(value);
728 if (remove_index >= 0)
734 int count = other.Count();
735 for (
int i = 0; i < count; i++)
744 Print(
string.Format(
"Set count: %1",
Count()));
745 for (
int i = 0; i <
Count(); i++)
748 Print(
string.Format(
"[%1] => %2", i, item));
799 proto TValue
Get(TKey key);
810 proto
bool Find(TKey key, out TValue val);
835 proto
void Set(TKey key, TValue value);
859 proto
bool Insert(TKey key, TValue value);
865 for (
int i = 0; i <
Count(); i++)
866 keys.Insert(GetKey(i));
873 for (
int i = 0; i <
Count(); i++)
880 if (Contains(old_key))
882 Set(new_key,
Get(old_key));
892 for (
int i = 0; i <
Count(); i++)
906 for (
int i = 0; i <
Count(); i++)
void Remove(Object object)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DisplayElementBase GetElement(eDisplayElements element_id)
enum MagnumStableStateID init
array< ref PlayerStatBase > Get()
Super root of all classes in Enforce script.
Module containing compiled scripts.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
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.
map< Managed, int > TManagedIntMap
proto native void Sort(bool reverse=false)
map< Managed, Class > TManagedClassMap
map< typename, float > TTypeNameFloatMap
proto int ParseStringEx(inout string input, string token)
Parses one token from input string. Result is put into token string, and type of token is returned....
proto int Insert(T value)
static proto int SetClassVar(Class inst, string varname, int index, void input)
Dynamic write to variable by its name.
void InsertAll(notnull array< T > from)
Inserts all elements from array.
proto void Sort(void param_array[], int num)
Sorts static array of integers(ascendically) / floats(ascendically) / strings(alphabetically)
array< typename > TTypenameArray
static proto int SetVar(out void var, string value)
Sets variable value by value in string.
array< float > TFloatArray
map< Class, vector > TClassVectorMap
map< Class, typename > TClassTypenameMap
int MoveIndex(int curr_index, int move_number)
Returns a index in array moved by specific number.
proto void RemoveElement(int i)
array< TKey > GetKeyArray()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
proto native void Clear()
map< ref Managed, Managed > TManagedRefManagedMap
proto int Insert(T value)
array< string > TStringArray
static proto int GetClassVar(Class inst, string varname, int index, out void result)
Dynamic read of variable value by its name.
void SwapItems(int item1_index, int item2_index)
map< int, Class > TIntClassMap
proto native MapIterator End()
map< Class, float > TClassFloatMap
proto void Set(int n, T value)
map< string, vector > TStringVectorMap
proto native int KillThread(Class owner, string name)
Kills thread.
proto native owned external string ClassName()
Returns name of class-type.
map< int, string > TIntStringMap
map< int, float > TIntFloatMap
proto owned string ThreadFunction(Class owner, string name, int backtrace, out int linenumber)
Debug function. Returns current function on stack of the thread.
proto native external bool IsInherited(typename type)
Returns true when instance is of the type, or inherited one.
proto native void RemoveOrdered(int index)
proto void Remove(TKey key)
array< Managed > TManagedArray
map< ref Managed, vector > TManagedRefVectorMap
void RemoveItemUnOrdered(T value)
bool IsValidIndex(int index)
proto native void Clear()
proto TValue Get(TKey key)
map< ref Managed, float > TManagedRefFloatMap
array< vector > TVectorArray
array< ref Managed > TManagedRefArray
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
proto TKey GetIteratorKey(MapIterator it)
map< ref Managed, ref Managed > TManagedRefManagedRefMap
proto native void Swap(notnull array< T > other)
proto volatile int CallFunctionParams(Class inst, string function, out void returnVal, Class parms)
proto int InsertAt(T value, int index)
map< Class, Class > TClassClassMap
static proto native ScriptModule LoadScript(ScriptModule parentModule, string scriptFile, bool listing)
Do load script and create ScriptModule for it.
proto int Copy(notnull array< T > from)
int GetRandomIndex()
Returns a random index of array. If Count is 0, return index is -1 .
array< Class > TClassArray
map< Class, int > TClassIntMap
proto void copyarray(void destArray, void srcArray)
proto bool Contains(TKey key)
static proto void Watch(void var, int flags)
Debug tool for watching certain variable. Invokes debugger whenever is variable used.
proto native external Type()
Returns typename of object's class.
array< TValue > GetValueArray()
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
TKey GetKeyByValue(TValue value)
map< ref Managed, typename > TManagedRefTypenameMap
void InsertSet(set< T > other)
map< Managed, typename > TManagedTypenameMap
proto TValue GetIteratorElement(MapIterator it)
map< string, int > TStringIntMap
proto volatile void Idle()
set< ref Managed > TManagedRefSet
void InsertArray(array< T > other)
map< typename, vector > TTypeNameVectorMap
proto native void Release()
map< ref Managed, string > TManagedRefStringMap
map< int, typename > TIntTypenameMap
map< Class, ref Managed > TClassManagedRefMap
proto volatile int Call(Class inst, string function, void parm)
map< Managed, Managed > TManagedManagedMap
proto native void Reserve(int newSize)
proto native void Resize(int newSize)
map< typename, Managed > TTypeNameManagedMap
proto volatile int CallFunction(Class inst, string function, out void returnVal, void parm)
proto static external StaticType()
Returns typename of object's reference.
proto bool Insert(TKey key, TValue value)
bool ReplaceKey(TKey old_key, TKey new_key)
proto void reversearray(void param_array)
map< Managed, ref Managed > TManagedManagedRefMap
proto native MapIterator Next(MapIterator it)
void RemoveItems(set< T > other)
map< string, ref Managed > TStringManagedRefMap
proto native void Clear()
map< typename, ref Managed > TTypeNameManagedRefMap
map< typename, int > TTypeNameIntMap
proto native MapIterator Begin()
static StaticGetType(typename t)
Returns typename of class even without a variable or instance.
map< string, string > TStringStringMap
map< Class, string > TClassStringMap
map< int, int > TIntIntMap
void Debug()
Print all elements in array.
proto external string ToString()
int DifferentAtPosition(array< T > pOtherArray)
Returns an index where 2 arrays start to differ from each other.
map< string, float > TStringFloatMap
map< ref Managed, int > TManagedRefIntMap
T GetRandomElement()
Returns a random element of array.
proto native void Remove(int index)
proto void Set(TKey key, TValue value)
map< typename, Class > TTypeNameClassMap
bool GetKeyByValueChecked(TValue value, out TKey key)
static proto Class Cast(Class from)
Try to safely down-cast base class to child class.
map< string, Class > TStringClassMap
int[] TypeID
script representation for C++ RTTI types
proto TValue GetElement(int index)
set< typename > TTypenameSet
map< typename, string > TTypeNameStringMap
proto int InsertAt(T value, int index)
map< int, Managed > TIntManagedMap
map< string, typename > TStringTypenameMap
map< Managed, float > TManagedFloatMap
proto int Copy(set< T > from)
proto int Copy(map< TKey, TValue > from)
proto native void Swap(set< T > other)
static proto bool SafeCastType(Class type, out Class to, Class from)
This function is for internal script usage.
proto bool Find(TKey key, out TValue val)
map< int, vector > TIntVectorMap
set< Managed > TManagedSet
map< int, ref Managed > TIntManagedRefMap
map< typename, typename > TTypeNameTypenameMap
map< ref Managed, Class > TManagedRefClassMap
proto native void Remove(int index)
map< Managed, string > TManagedStringMap
map< Managed, vector > TManagedVectorMap
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].