Show / Hide Table of Contents

Class VariableList

Class that allows to easily manage a list of CVar objects.

Inheritance
System.Object
VariableList
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: RuriLib.Models
Assembly: RuriLib.dll
Syntax
public class VariableList

Constructors

| Improve this Doc View Source

VariableList()

Standard constructor that initializes an empty variable list.

Declaration
public VariableList()
| Improve this Doc View Source

VariableList(List<CVar>)

Initializes a variable list starting from an existing list of variables.

Declaration
public VariableList(List<CVar> list)
Parameters
Type Name Description
System.Collections.Generic.List<CVar> list

The list of variables.

Properties

| Improve this Doc View Source

All

The whole list of variables.

Declaration
public List<CVar> All { get; set; }
Property Value
Type Description
System.Collections.Generic.List<CVar>
| Improve this Doc View Source

Captures

The list of all variables marked as Capture.

Declaration
[JsonIgnore]
public List<CVar> Captures { get; }
Property Value
Type Description
System.Collections.Generic.List<CVar>
| Improve this Doc View Source

Dictionaries

The list of all variables of type Dictionary.

Declaration
[JsonIgnore]
public List<CVar> Dictionaries { get; }
Property Value
Type Description
System.Collections.Generic.List<CVar>
| Improve this Doc View Source

Lists

The list of all variables of type List.

Declaration
[JsonIgnore]
public List<CVar> Lists { get; }
Property Value
Type Description
System.Collections.Generic.List<CVar>
| Improve this Doc View Source

Singles

The list of all variables of type Single.

Declaration
[JsonIgnore]
public List<CVar> Singles { get; }
Property Value
Type Description
System.Collections.Generic.List<CVar>

Methods

| Improve this Doc View Source

Get(String)

Gets a variable given its name.

Declaration
public CVar Get(string name)
Parameters
Type Name Description
System.String name

The name of the variable

Returns
Type Description
CVar

The variable or null if it wasn't found.

| Improve this Doc View Source

Get(String, CVar.VarType)

Gets a variable given its name and type.

Declaration
public CVar Get(string name, CVar.VarType type)
Parameters
Type Name Description
System.String name

The name of the variable

CVar.VarType type

The type of the variable

Returns
Type Description
CVar

The variable or null if it wasn't found.

| Improve this Doc View Source

GetDictionary(String)

Helper method that gets the value of a variable of type Dictionary.

Declaration
public Dictionary<string, string> GetDictionary(string name)
Parameters
Type Name Description
System.String name

The name of the Dictionary variable

Returns
Type Description
System.Collections.Generic.Dictionary<System.String, System.String>

The dictionary value or null if it wasn't found.

| Improve this Doc View Source

GetList(String)

Helper method that gets the value of a variable of type List.

Declaration
public List<string> GetList(string name)
Parameters
Type Name Description
System.String name

The name of the List variable

Returns
Type Description
System.Collections.Generic.List<System.String>

The list of strings value or null if it wasn't found.

| Improve this Doc View Source

GetSingle(String)

Helper method that gets the value of a variable of type Single.

Declaration
public string GetSingle(string name)
Parameters
Type Name Description
System.String name

The name of the Single variable

Returns
Type Description
System.String

The string value or null if it wasn't found.

| Improve this Doc View Source

Remove(Condition, String, BotData)

Removes all non-hidden variables if their name matches a condition.

The name of the variables in the list are the left-hand term of the comparison.

Declaration
public void Remove(Condition cond, string name, BotData data)
Parameters
Type Name Description
Condition cond

The condition type

System.String name

The right-hand term of the comparison

BotData data

The BotData object used for variable replacement

| Improve this Doc View Source

Remove(String)

Removes a non-hidden variable given its name.

Declaration
public void Remove(string name)
Parameters
Type Name Description
System.String name

The name of the variable to remove

| Improve this Doc View Source

Set(CVar)

Adds a CVar object to the variable list.

Declaration
public void Set(CVar variable)
Parameters
Type Name Description
CVar variable

The CVar object to add

| Improve this Doc View Source

SetHidden(String, Object)

Adds a hidden CVar object to the variable list.

Declaration
public void SetHidden(string name, dynamic value)
Parameters
Type Name Description
System.String name

The name of the variable to add

System.Object value

The value of the variable to add

| Improve this Doc View Source

SetNew(CVar)

Adds a CVar object to the variable list only if no other variable with the same name exists.

Declaration
public void SetNew(CVar variable)
Parameters
Type Name Description
CVar variable

The CVar object to add

| Improve this Doc View Source

ToCaptureString()

Generates a string where all the variables marked as Capture are printed in an organized fashion.

Declaration
public string ToCaptureString()
Returns
Type Description
System.String

The chained capture string.

| Improve this Doc View Source

VariableExists(String)

Helper method that checks if a variable exists given its name.

Declaration
public bool VariableExists(string name)
Parameters
Type Name Description
System.String name

The name of the variable

Returns
Type Description
System.Boolean

True if the variable exists

| Improve this Doc View Source

VariableExists(String, CVar.VarType)

Helper method that checks if a variable exists given its name and type.

Declaration
public bool VariableExists(string name, CVar.VarType type)
Parameters
Type Name Description
System.String name

The name of the variable

CVar.VarType type

The type of the variable

Returns
Type Description
System.Boolean

True if the variable exists and matches the given type

  • Improve this Doc
  • View Source
Back to top Generated by DocFX