Arma Reforger Script API
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
SCR_Enum Interface Reference

Static Public Member Functions

static bool HasFlag (int flags, int condition)
 Check if flags enum contains all required flags.
 
static bool HasPartialFlag (int flags, int condition)
 Check if flags enum contains at least one required flag.
 
static int SetFlag (int flags, int flagToSet)
 Adds the given flag to Flags.
 
static int RemoveFlag (int flags, int flagToRemove)
 Removes the given flag to Flags.
 
static int BitToIntArray (int bitValue, out notnull array< int > intValues)
 Convert bit array to integer array.
 
static int IntToBitArray (notnull array< int > intValues)
 Convert integer array to bit array.
 
static string GetEnumName (TypeName enumType, int enumValue)
 Get string value of an enum.
 
static int GetEnumNames (TypeName enumType, out notnull array< string > stringValues)
 Get all value names within an enum.
 
static int GetEnumValues (TypeName enumType, out notnull array< int > intValues)
 Get all values within an enum.
 
static int GetPreviousEnumValue (TypeName enumType, int value)
 Finds and returns the previous enum value even when it was modded.
 
static int GetNextEnumValue (TypeName enumType, int value)
 Finds and returns the next enum value even when it was modded.
 
static int GetFlagValues (TypeName enumType)
 Get all values within an enum as bitwise flags.
 
static bool GetRange (TypeName enumType, out int min, out int max)
 Get range of enum values.
 
static ParamEnumArray GetList (TypeName e, ParamEnum customValue1=null, ParamEnum customValue2=null, ParamEnum customValue3=null)
 Get enum array with optional custom values.
 
static ParamEnumArray GetList (notnull array< string > names)
 Get enum array with linear values: 0, 1, 2, 3, ...
 
static ParamEnumArray GetFlags (notnull array< string > names)
 Get enum array with flag values: 1, 2, 4, 8, ...
 
static string FlagsToString (TypeName e, int flags, string delimiter=", ", string noValue="N/A")
 Show flag value names in a string.
 
static string GetDefault (int enumValue)
 Use enum as a default value in [Attribute()] field.
 
static string GetDefault (TypeName enumType)
 Use sum of all flag enum values as a default value in [Attribute()] field.
 

Detailed Description

Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

Member Function Documentation

◆ BitToIntArray()

static int SCR_Enum.BitToIntArray ( int  bitValue,
out notnull array< int >  intValues 
)
static

Convert bit array to integer array.

Parameters
Bitvalue
[out]intValuesArray of integer values
Returns
Size of the array

◆ FlagsToString()

static string SCR_Enum.FlagsToString ( TypeName  e,
int  flags,
string  delimiter = ", ",
string  noValue = "N/A" 
)
static

Show flag value names in a string.

Parameters
eFlags enum type
flagsFlag values
delimiterString to be placed between value names
noValueString to be used when the flag has no value, e.g., is 0
Returns
Flag value names (e.g., "VALUE1, VALUE2, VALUE3")

◆ GetDefault() [1/2]

static string SCR_Enum.GetDefault ( int  enumValue)
static

Use enum as a default value in [Attribute()] field.

Parameters
enumValueValue
Returns
Compatible default value
Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

◆ GetDefault() [2/2]

static string SCR_Enum.GetDefault ( TypeName  enumType)
static

Use sum of all flag enum values as a default value in [Attribute()] field.

Parameters
enumTypeEnum type
Returns
Compatible default value

◆ GetEnumName()

static string SCR_Enum.GetEnumName ( TypeName  enumType,
int  enumValue 
)
static

Get string value of an enum.

Parameters
enumTypeenum type
enumValueenum value
Returns
string enum name

◆ GetEnumNames()

static int SCR_Enum.GetEnumNames ( TypeName  enumType,
out notnull array< string >  stringValues 
)
static

Get all value names within an enum.

Parameters
enumTypeType of the enum
[out]stringValuesArray of enum values
Returns
Size of the array

◆ GetEnumValues()

static int SCR_Enum.GetEnumValues ( TypeName  enumType,
out notnull array< int >  intValues 
)
static

Get all values within an enum.

Parameters
enumTypeType of the enum
[out]intValuesArray of enum values
Returns
Size of the array

◆ GetFlags()

static ParamEnumArray SCR_Enum.GetFlags ( notnull array< string >  names)
static

Get enum array with flag values: 1, 2, 4, 8, ...

Parameters
namesValue names
Returns
Array of enums to be used in variable attributes after enum: keyword.

◆ GetFlagValues()

static int SCR_Enum.GetFlagValues ( TypeName  enumType)
static

Get all values within an enum as bitwise flags.

Parameters
enumTypeType of the enum
Returns
Flags

◆ GetList() [1/2]

static ParamEnumArray SCR_Enum.GetList ( notnull array< string >  names)
static

Get enum array with linear values: 0, 1, 2, 3, ...

Parameters
namesValue names
Returns
Array of enums to be used in variable attributes after enum: keyword.

◆ GetList() [2/2]

static ParamEnumArray SCR_Enum.GetList ( TypeName  e,
ParamEnum  customValue1 = null,
ParamEnum  customValue2 = null,
ParamEnum  customValue3 = null 
)
static

Get enum array with optional custom values.

Parameters
eEnum type
customValue11st custom value added at the beginning of enum array
customValue22nd custom value added at the beginning of enum array
customValue33rd custom value added at the beginning of enum array
Returns
Array of enums to be used in variable attributes after enum: keyword.

◆ GetNextEnumValue()

static int SCR_Enum.GetNextEnumValue ( TypeName  enumType,
int  value 
)
static

Finds and returns the next enum value even when it was modded.

Parameters
[in]enumType
[in]value
Returns
next (bigger) enum value or one that was provided if it the last value for this enum type

◆ GetPreviousEnumValue()

static int SCR_Enum.GetPreviousEnumValue ( TypeName  enumType,
int  value 
)
static

Finds and returns the previous enum value even when it was modded.

Parameters
[in]enumType
[in]value
Returns
previous (smaller) enum value or one that was provided if it the last value for this enum type

◆ GetRange()

static bool SCR_Enum.GetRange ( TypeName  enumType,
out int  min,
out int  max 
)
static

Get range of enum values.

Parameters
enumTypeType of the enum
[out]minMinimum value
[out]maxMaximum value
Returns
True if there are any values

◆ HasFlag()

static bool SCR_Enum.HasFlag ( int  flags,
int  condition 
)
static

Check if flags enum contains all required flags.

Parameters
flagsList of flags
conditionQueried flag
Returns
True if flags contains required flags

◆ HasPartialFlag()

static bool SCR_Enum.HasPartialFlag ( int  flags,
int  condition 
)
static

Check if flags enum contains at least one required flag.

Parameters
flagsList of flags
conditionQueried flag
Returns
True if flags contains one of required flags

◆ IntToBitArray()

static int SCR_Enum.IntToBitArray ( notnull array< int >  intValues)
static

Convert integer array to bit array.

Parameters
[out]intValuesArray of integer values
Returns
Bit value

◆ RemoveFlag()

static int SCR_Enum.RemoveFlag ( int  flags,
int  flagToRemove 
)
static

Removes the given flag to Flags.

Parameters
flagsList of flags
flagToRemoveFlag to remove
Returns
New flags value

◆ SetFlag()

static int SCR_Enum.SetFlag ( int  flags,
int  flagToSet 
)
static

Adds the given flag to Flags.

Parameters
flagsList of flags
flagToSetFlag to add
Returns
New flags value

The documentation for this interface was generated from the following file: