Class CVar
Represents a variable.
Inheritance
Inherited Members
Namespace: RuriLib.Models
Assembly: RuriLib.dll
Syntax
public class CVar
Constructors
| Improve this Doc View SourceCVar()
Needed for NoSQL deserialization.
Declaration
public CVar()
CVar(String, CVar.VarType, Object, Boolean, Boolean)
Creates a variable of a given type.
Declaration
public CVar(string name, CVar.VarType type, dynamic value, bool isCapture = false, bool hidden = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The variable name |
CVar.VarType | type | The variable type |
System.Object | value | The dynamic variable value |
System.Boolean | isCapture | Whether the variable is marked as Capture |
System.Boolean | hidden | Whether the variable is hidden |
CVar(String, Dictionary<String, String>, Boolean, Boolean)
Creates a variable of type Dictionary.
Declaration
public CVar(string name, Dictionary<string, string> value, bool isCapture = false, bool hidden = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The variable name |
System.Collections.Generic.Dictionary<System.String, System.String> | value | The variable value as a dictionary of strings |
System.Boolean | isCapture | Whether the variable is marked as Capture |
System.Boolean | hidden | Whether the variable is hidden |
CVar(String, List<String>, Boolean, Boolean)
Creates a variable of type List.
Declaration
public CVar(string name, List<string> value, bool isCapture = false, bool hidden = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The variable name |
System.Collections.Generic.List<System.String> | value | The variable value as a list of strings |
System.Boolean | isCapture | Whether the variable is marked as Capture |
System.Boolean | hidden | Whether the variable is hidden |
CVar(String, String, Boolean, Boolean)
Creates a variable of type Single.
Declaration
public CVar(string name, string value, bool isCapture = false, bool hidden = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The variable name |
System.String | value | The variable value as a single string |
System.Boolean | isCapture | Whether the variable is marked as Capture |
System.Boolean | hidden | Whether the variable is hidden |
Properties
| Improve this Doc View SourceHidden
Whether the variable is hidden and shouldn't be displayed to the user.
Declaration
public bool Hidden { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsCapture
Whether the variable is used for the final capture.
Declaration
public bool IsCapture { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
The variable name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Type
The variable type (it determines which type of value is expected).
Declaration
public CVar.VarType Type { get; set; }
Property Value
Type | Description |
---|---|
CVar.VarType |
Value
The dynamic variable value.
Declaration
public dynamic Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Methods
| Improve this Doc View SourceGetDictKey(String)
Gets an item from a Dictionary Value.
Declaration
public string GetDictKey(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value of the dictionary entry |
Returns
Type | Description |
---|---|
System.String | The key of the Dictionary variable's entry |
GetDictValue(String)
Gets an item from a Dictionary Key.
Declaration
public string GetDictValue(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the dictionary entry |
Returns
Type | Description |
---|---|
System.String | The value of the Dictionary variable's entry |
GetListItem(Int32)
Gets an item from a List variable.
Declaration
public string GetListItem(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the item |
Returns
Type | Description |
---|---|
System.String | The item of the List variable's value |
ToString()
Outputs a string from a variable.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | The formatted value of the value as a single string |