Multiplayer Reference
Class DatabaseArray
Namespace: PlayerIO.GameLibrary
Language: C# / .NET
Represents an BigDB array of values that can be accessed by index.
DatabaseArray is very similar to the DatabaseObject class since it has methods for getting, setting, checking and removing values. But unlike DatabaseObject, this class also has methods for adding and inserting values, and there is no Save method, since these cannot be saved to a BigDB table, they always have to be a property of an object.
If we for example have an object that can be visualized like this:
Then we would create it in BigDB like this:
However, just like DatabaseObject, DatabaseArray also supports nested property names, and we can refer to values in the array with their index number. Using this, we can make the example object in an easier way, like this:
Getting values works exactly like for DatabaseObject, and we can also use nested properties.
In addition to getting and setting values, we can also add values to the end of the array, insert values in the middle of it, or remove values in the middle of it. Note that the arrays are sparse, this means that removing a value doesn't shift the indexes of the following values, and we can set any value beyond the last value of the array.
Properties | |||
---|---|---|---|
public int |
Returns the number of values in this array. If set to a smaller number than the current count, it will truncate the array. |
||
public IEnumerable<int> |
Returns an enumerator that iterates over the indexes in this array that contain values. |
||
public IEnumerable<KeyValuePair<int, object>> |
Returns an enumerator that iterates over all the indexes and values in this array. |
||
Methods | |||
public DatabaseArray |
Add the given long value to the array |
||
public DatabaseArray |
Add the given bool value to the array |
||
public DatabaseArray |
Add the given uint value to the array |
||
public DatabaseArray |
Add the given string value to the array |
||
public DatabaseArray |
Add the given int value to the array |
||
public DatabaseArray |
Add the given float value to the array |
||
public DatabaseArray |
Add the given object to the array |
||
public DatabaseArray |
Add the given array to the array |
||
public DatabaseArray |
Add the given datetime value to the array |
||
public DatabaseArray |
Add the given double value to the array |
||
public DatabaseArray |
Add the given byte array value to the array |
||
public void |
Remove all values from this array |
||
public bool |
Returns true if the given property exists on this object |
||
public bool |
Returns true if a value exists at the given index |
||
public DatabaseArray |
Get the array at the given index |
||
public DatabaseArray |
Get the given array property |
||
public bool |
Get the bool value at the given index |
||
public bool |
Get the given bool property |
||
public bool |
Get the given bool property, falling back to the given default value if the bool property does not exist |
||
public bool |
Get the bool value at the given index, falling back to the given default value if the value was at the index is null |
||
public Byte[] |
Get the given byte array property |
||
public Byte[] |
Get the given byte array property, falling back to the given default value if the byte array property does not exist |
||
public Byte[] |
Get the byte array value at the given index |
||
public Byte[] |
Get the byte value at the given index, falling back to the given default value if the value was at the index is null |
||
public DateTime |
Get the given datetime property |
||
public DateTime |
Get the datetime value at the given index |
||
public DateTime |
Get the datetime value at the given index, falling back to the given default value if the value was at the index is null |
||
public DateTime |
Get the given datetime property, falling back to the given default value if the datetime property does not exist |
||
public Double |
Get the double value at the given index |
||
public Double |
Get the double value at the given index, falling back to the given default value if the value was at the index is null |
||
public Double |
Get the given double property |
||
public Double |
Get the given double property, falling back to the given default value if the double property does not exist |
||
public Single |
Get the given float property, falling back to the given default value if the float property does not exist |
||
public Single |
Get the given float property |
||
public Single |
Get the float value at the given index |
||
public Single |
Get the float value at the given index, falling back to the given default value if the value was at the index is null |
||
public int |
Get the given int property, falling back to the given default value if the int property does not exist |
||
public int |
Get the given int property |
||
public int |
Get the int value at the given index, falling back to the given default value if the value was at the index is null |
||
public int |
Get the int value at the given index |
||
public Int64 |
Get the long value at the given index, falling back to the given default value if the value was at the index is null |
||
public Int64 |
Get the long value at the given index |
||
public Int64 |
Get the given long property, falling back to the given default value if the long property does not exist |
||
public Int64 |
Get the given long property |
||
public DatabaseObject |
Get the object at the given index |
||
public DatabaseObject |
Get the given object property |
||
public string |
Get the given string property |
||
public string |
Get the string value at the given index |
||
public string |
Get the string value at the given index, falling back to the given default value if the value was at the index is null |
||
public string |
Get the given string property, falling back to the given default value if the string property does not exist |
||
public uint |
Get the given uint property |
||
public uint |
Get the given uint property, falling back to the given default value if the uint property does not exist |
||
public uint |
Get the uint value at the given index |
||
public uint |
Get the uint value at the given index, falling back to the given default value if the value was at the index is null |
||
public object |
Get the given property as an object |
||
public object |
Get the value at the given index as an object |
||
public DatabaseArray |
Insert the given byte array value at the given index |
||
public DatabaseArray |
Insert the given datetime value at the given index |
||
public DatabaseArray |
Insert the given long value at the given index |
||
public DatabaseArray |
Insert the given float value at the given index |
||
public DatabaseArray |
Insert the given double value at the given index |
||
public DatabaseArray |
Insert the given bool value at the given index |
||
public DatabaseArray |
Insert the given object at the given index |
||
public DatabaseArray |
Insert the given string value at the given index |
||
public DatabaseArray |
Insert the given int value at the given index |
||
public DatabaseArray |
Insert the given array at the given index |
||
public DatabaseArray |
Insert the given uint value at the given index |
||
public DatabaseArray |
Removes the value of the given property from this object |
||
public void |
Remove the value at the given index |
||
public DatabaseArray |
Set the given property to the given double value |
||
public DatabaseArray |
Set the given property to the given byte array value |
||
public DatabaseArray |
Set the given property to the given float value |
||
public DatabaseArray |
Set the given property to the given long value |
||
public DatabaseArray |
Set the given property to the given bool value |
||
public DatabaseArray |
Set the value at the given index to the given object |
||
public DatabaseArray |
Set the value at the given index to the given long |
||
public DatabaseArray |
Set the given property to the given array |
||
public DatabaseArray |
Set the given property to the given datetime value |
||
public DatabaseArray |
Set the given property to the given object |
||
public DatabaseArray |
Set the given property to the given uint value |
||
public DatabaseArray |
Set the value at the given index to the given byte array |
||
public DatabaseArray |
Set the value at the given index to the given uint |
||
public DatabaseArray |
Set the value at the given index to the given bool |
||
public DatabaseArray |
Set the value at the given index to the given double |
||
public DatabaseArray |
Set the value at the given index to the given float |
||
public DatabaseArray |
Set the value at the given index to the given int |
||
public DatabaseArray |
Set the given property to the given string value |
||
public DatabaseArray |
Set the given property to the given int value |
||
public DatabaseArray |
Set the value at the given index to the given datetime |
||
public DatabaseArray |
Set the value at the given index to the given string |
||
public DatabaseArray |
Set the value at the given index to the given array |
DatabaseArray.Count
public int |
|
Returns the number of values in this array. If set to a smaller number than the current count, it will truncate the array.
DatabaseArray.Indexes
public IEnumerable<int> |
|
Returns an enumerator that iterates over the indexes in this array that contain values.
DatabaseArray.IndexesAndValues
public IEnumerable<KeyValuePair<int, object>> |
|
Returns an enumerator that iterates over all the indexes and values in this array.
DatabaseArray.Add
public DatabaseArray |
|
Add the given long value to the array
Arguments
Int64 | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given bool value to the array
Arguments
bool | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given uint value to the array
Arguments
uint | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given string value to the array
Arguments
string | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given int value to the array
Arguments
int | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given float value to the array
Arguments
Single | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given object to the array
Arguments
DatabaseObject | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given array to the array
Arguments
DatabaseArray | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given datetime value to the array
Arguments
DateTime | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given double value to the array
Arguments
Double | value |
DatabaseArray.Add
public DatabaseArray |
|
Add the given byte array value to the array
Arguments
Byte[] | value |
DatabaseArray.Clear
public void |
|
Remove all values from this array
DatabaseArray.Contains
public bool |
|
Returns true if the given property exists on this object
Arguments
string | propertyExpression |
DatabaseArray.Contains
public bool |
|
Returns true if a value exists at the given index
Arguments
int | index |
DatabaseArray.GetArray
public DatabaseArray |
|
Get the array at the given index
Arguments
int | index |
DatabaseArray.GetArray
public DatabaseArray |
|
Get the given array property
Arguments
string | propertyExpression |
DatabaseArray.GetBool
public bool |
|
Get the bool value at the given index
Arguments
int | index |
DatabaseArray.GetBool
public bool |
|
Get the given bool property
Arguments
string | propertyExpression |
DatabaseArray.GetBool
public bool |
|
Get the given bool property, falling back to the given default value if the bool property does not exist
Arguments
string | propertyExpression |
bool | defaultValue |
DatabaseArray.GetBool
public bool |
|
Get the bool value at the given index, falling back to the given default value if the value was at the index is null
Arguments
int | index |
bool | defaultValue |
DatabaseArray.GetBytes
public Byte[] |
|
Get the given byte array property
Arguments
string | propertyExpression |
DatabaseArray.GetBytes
public Byte[] |
|
Get the given byte array property, falling back to the given default value if the byte array property does not exist
Arguments
string | propertyExpression |
Byte[] | defaultValue |
DatabaseArray.GetBytes
public Byte[] |
|
Get the byte array value at the given index
Arguments
int | index |
DatabaseArray.GetBytes
public Byte[] |
|
Get the byte value at the given index, falling back to the given default value if the value was at the index is null
Arguments
int | index |
Byte[] | defaultValue |
DatabaseArray.GetDateTime
public DateTime |
|
Get the given datetime property
Arguments
string | propertyExpression |
DatabaseArray.GetDateTime
public DateTime |
|
Get the datetime value at the given index
Arguments
int | index |
DatabaseArray.GetDateTime
public DateTime |
|
Get the datetime value at the given index, falling back to the given default value if the value was at the index is null
Arguments
int | index |
DateTime | defaultValue |
DatabaseArray.GetDateTime
public DateTime |
|
Get the given datetime property, falling back to the given default value if the datetime property does not exist
Arguments
string | propertyExpression |
DateTime | defaultValue |
DatabaseArray.GetDouble
public Double |
|
Get the double value at the given index
Arguments
int | index |
DatabaseArray.GetDouble
public Double |
|
Get the double value at the given index, falling back to the given default value if the value was at the index is null
Arguments
int | index |
Double | defaultValue |
DatabaseArray.GetDouble
public Double |
|
Get the given double property
Arguments
string | propertyExpression |
DatabaseArray.GetDouble
public Double |
|
Get the given double property, falling back to the given default value if the double property does not exist
Arguments
string | propertyExpression |
Double | defaultValue |
DatabaseArray.GetFloat
public Single |
|
Get the given float property, falling back to the given default value if the float property does not exist
Arguments
string | propertyExpression |
Single | defaultValue |
DatabaseArray.GetFloat
public Single |
|
Get the given float property
Arguments
string | propertyExpression |
DatabaseArray.GetFloat
public Single |
|
Get the float value at the given index
Arguments
int | index |
DatabaseArray.GetFloat
public Single |
|
Get the float value at the given index, falling back to the given default value if the value was at the index is null
Arguments
int | index |
Single | defaultValue |
DatabaseArray.GetInt
public int |
|
Get the given int property, falling back to the given default value if the int property does not exist
Arguments
string | propertyExpression |
int | defaultValue |
DatabaseArray.GetInt
public int |
|
Get the given int property
Arguments
string | propertyExpression |
DatabaseArray.GetInt
public int |
|
Get the int value at the given index, falling back to the given default value if the value was at the index is null
Arguments
int | index |
int | defaultValue |
DatabaseArray.GetInt
public int |
|
Get the int value at the given index
Arguments
int | index |
DatabaseArray.GetLong
public Int64 |
|
Get the long value at the given index, falling back to the given default value if the value was at the index is null
Arguments
int | index |
Int64 | defaultValue |
DatabaseArray.GetLong
public Int64 |
|
Get the long value at the given index
Arguments
int | index |
DatabaseArray.GetLong
public Int64 |
|
Get the given long property, falling back to the given default value if the long property does not exist
Arguments
string | propertyExpression |
Int64 | defaultValue |
DatabaseArray.GetLong
public Int64 |
|
Get the given long property
Arguments
string | propertyExpression |
DatabaseArray.GetObject
public DatabaseObject |
|
Get the object at the given index
Arguments
int | index |
DatabaseArray.GetObject
public DatabaseObject |
|
Get the given object property
Arguments
string | propertyExpression |
DatabaseArray.GetString
public string |
|
Get the given string property
Arguments
string | propertyExpression |
DatabaseArray.GetString
public string |
|
Get the string value at the given index
Arguments
int | index |
DatabaseArray.GetString
public string |
|
Get the string value at the given index, falling back to the given default value if the value was at the index is null
Arguments
int | index |
string | defaultValue |
DatabaseArray.GetString
public string |
|
Get the given string property, falling back to the given default value if the string property does not exist
Arguments
string | propertyExpression |
string | defaultValue |
DatabaseArray.GetUInt
public uint |
|
Get the given uint property
Arguments
string | propertyExpression |
DatabaseArray.GetUInt
public uint |
|
Get the given uint property, falling back to the given default value if the uint property does not exist
Arguments
string | propertyExpression |
uint | defaultValue |
DatabaseArray.GetUInt
public uint |
|
Get the uint value at the given index
Arguments
int | index |
DatabaseArray.GetUInt
public uint |
|
Get the uint value at the given index, falling back to the given default value if the value was at the index is null
Arguments
int | index |
uint | defaultValue |
DatabaseArray.GetValue
public object |
|
Get the given property as an object
Arguments
string | propertyExpression |
DatabaseArray.GetValue
public object |
|
Get the value at the given index as an object
Arguments
int | index |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given byte array value at the given index
Arguments
int | index |
Byte[] | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given datetime value at the given index
Arguments
int | index |
DateTime | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given long value at the given index
Arguments
int | index |
Int64 | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given float value at the given index
Arguments
int | index |
Single | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given double value at the given index
Arguments
int | index |
Double | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given bool value at the given index
Arguments
int | index |
bool | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given object at the given index
Arguments
int | index |
DatabaseObject | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given string value at the given index
Arguments
int | index |
string | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given int value at the given index
Arguments
int | index |
int | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given array at the given index
Arguments
int | index |
DatabaseArray | value |
DatabaseArray.Insert
public DatabaseArray |
|
Insert the given uint value at the given index
Arguments
int | index |
uint | value |
DatabaseArray.Remove
public DatabaseArray |
|
Removes the value of the given property from this object
Arguments
string | propertyExpression |
DatabaseArray.RemoveAt
public void |
|
Remove the value at the given index
Arguments
int | index |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given double value
Arguments
string | propertyExpression |
Double | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given byte array value
Arguments
string | propertyExpression |
Byte[] | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given float value
Arguments
string | propertyExpression |
Single | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given long value
Arguments
string | propertyExpression |
Int64 | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given bool value
Arguments
string | propertyExpression |
bool | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given object
Arguments
int | index |
DatabaseObject | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given long
Arguments
int | index |
Int64 | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given array
Arguments
string | propertyExpression |
DatabaseArray | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given datetime value
Arguments
string | propertyExpression |
DateTime | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given object
Arguments
string | propertyExpression |
DatabaseObject | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given uint value
Arguments
string | propertyExpression |
uint | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given byte array
Arguments
int | index |
Byte[] | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given uint
Arguments
int | index |
uint | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given bool
Arguments
int | index |
bool | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given double
Arguments
int | index |
Double | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given float
Arguments
int | index |
Single | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given int
Arguments
int | index |
int | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given string value
Arguments
string | propertyExpression |
string | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the given property to the given int value
Arguments
string | propertyExpression |
int | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given datetime
Arguments
int | index |
DateTime | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given string
Arguments
int | index |
string | value |
DatabaseArray.Set
public DatabaseArray |
|
Set the value at the given index to the given array
Arguments
int | index |
DatabaseArray | value |