PlayerIO

The fastest way to build online games without breaking a sweat.

Unity3D Client Reference

Multiplayer  class documentationClass DatabaseArray

Namespace: PlayerIOClient
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
Count

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>
Indexes  [read-only]

Returns an enumerator that iterates over the indexes in this array that contain values.

public IEnumerable<KeyValuePair<int, object>>
IndexesAndValues  [read-only]

Returns an enumerator that iterates over all the indexes and values in this array.

Methods

 
public DatabaseArray
Add (Int64 value)

Add the given long value to the array

public DatabaseArray
Add (bool value)

Add the given bool value to the array

public DatabaseArray
Add (uint value)

Add the given uint value to the array

public DatabaseArray
Add (string value)

Add the given string value to the array

public DatabaseArray
Add (int value)

Add the given int value to the array

public DatabaseArray
Add (Single value)

Add the given float value to the array

public DatabaseArray
Add (DatabaseObject value)

Add the given object to the array

public DatabaseArray
Add (DatabaseArray value)

Add the given array to the array

public DatabaseArray
Add (DateTime value)

Add the given datetime value to the array

public DatabaseArray
Add (Double value)

Add the given double value to the array

public DatabaseArray
Add (Byte[] value)

Add the given byte array value to the array

public void
Clear ()

Remove all values from this array

public bool
Contains (string propertyExpression)

Returns true if the given property exists on this object

public bool
Contains (int index)

Returns true if a value exists at the given index

public DatabaseArray
GetArray (int index)

Get the array at the given index

public DatabaseArray
GetArray (string propertyExpression)

Get the given array property

public bool
GetBool (int index)

Get the bool value at the given index

public bool
GetBool (string propertyExpression)

Get the given bool property

public bool
GetBool (string propertyExpression, bool defaultValue)

Get the given bool property, falling back to the given default value if the bool property does not exist

public bool
GetBool (int index, bool defaultValue)

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[]
GetBytes (string propertyExpression)

Get the given byte array property

public Byte[]
GetBytes (string propertyExpression, Byte[] defaultValue)

Get the given byte array property, falling back to the given default value if the byte array property does not exist

public Byte[]
GetBytes (int index)

Get the byte array value at the given index

public Byte[]
GetBytes (int index, Byte[] defaultValue)

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
GetDateTime (string propertyExpression)

Get the given datetime property

public DateTime
GetDateTime (int index)

Get the datetime value at the given index

public DateTime
GetDateTime (int index, DateTime defaultValue)

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
GetDateTime (string propertyExpression, DateTime defaultValue)

Get the given datetime property, falling back to the given default value if the datetime property does not exist

public Double
GetDouble (int index)

Get the double value at the given index

public Double
GetDouble (int index, Double defaultValue)

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
GetDouble (string propertyExpression)

Get the given double property

public Double
GetDouble (string propertyExpression, Double defaultValue)

Get the given double property, falling back to the given default value if the double property does not exist

public Single
GetFloat (string propertyExpression, Single defaultValue)

Get the given float property, falling back to the given default value if the float property does not exist

public Single
GetFloat (string propertyExpression)

Get the given float property

public Single
GetFloat (int index)

Get the float value at the given index

public Single
GetFloat (int index, Single defaultValue)

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
GetInt (string propertyExpression, int defaultValue)

Get the given int property, falling back to the given default value if the int property does not exist

public int
GetInt (string propertyExpression)

Get the given int property

public int
GetInt (int index, int defaultValue)

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
GetInt (int index)

Get the int value at the given index

public Int64
GetLong (int index, Int64 defaultValue)

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
GetLong (int index)

Get the long value at the given index

public Int64
GetLong (string propertyExpression, Int64 defaultValue)

Get the given long property, falling back to the given default value if the long property does not exist

public Int64
GetLong (string propertyExpression)

Get the given long property

public DatabaseObject
GetObject (int index)

Get the object at the given index

public DatabaseObject
GetObject (string propertyExpression)

Get the given object property

public string
GetString (string propertyExpression)

Get the given string property

public string
GetString (int index)

Get the string value at the given index

public string
GetString (int index, string defaultValue)

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
GetString (string propertyExpression, string defaultValue)

Get the given string property, falling back to the given default value if the string property does not exist

public uint
GetUInt (string propertyExpression)

Get the given uint property

public uint
GetUInt (string propertyExpression, uint defaultValue)

Get the given uint property, falling back to the given default value if the uint property does not exist

public uint
GetUInt (int index)

Get the uint value at the given index

public uint
GetUInt (int index, uint defaultValue)

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
GetValue (string propertyExpression)

Get the given property as an object

public object
GetValue (int index)

Get the value at the given index as an object

public DatabaseArray
Insert (int index, Byte[] value)

Insert the given byte array value at the given index

public DatabaseArray
Insert (int index, DateTime value)

Insert the given datetime value at the given index

public DatabaseArray
Insert (int index, Int64 value)

Insert the given long value at the given index

public DatabaseArray
Insert (int index, Single value)

Insert the given float value at the given index

public DatabaseArray
Insert (int index, Double value)

Insert the given double value at the given index

public DatabaseArray
Insert (int index, bool value)

Insert the given bool value at the given index

public DatabaseArray
Insert (int index, DatabaseObject value)

Insert the given object at the given index

public DatabaseArray
Insert (int index, string value)

Insert the given string value at the given index

public DatabaseArray
Insert (int index, int value)

Insert the given int value at the given index

public DatabaseArray
Insert (int index, DatabaseArray value)

Insert the given array at the given index

public DatabaseArray
Insert (int index, uint value)

Insert the given uint value at the given index

public DatabaseArray
Remove (string propertyExpression)

Removes the value of the given property from this object

public void
RemoveAt (int index)

Remove the value at the given index

public DatabaseArray
Set (string propertyExpression, Double value)

Set the given property to the given double value

public DatabaseArray
Set (string propertyExpression, Byte[] value)

Set the given property to the given byte array value

public DatabaseArray
Set (string propertyExpression, Single value)

Set the given property to the given float value

public DatabaseArray
Set (string propertyExpression, Int64 value)

Set the given property to the given long value

public DatabaseArray
Set (string propertyExpression, bool value)

Set the given property to the given bool value

public DatabaseArray
Set (int index, DatabaseObject value)

Set the value at the given index to the given object

public DatabaseArray
Set (int index, Int64 value)

Set the value at the given index to the given long

public DatabaseArray
Set (string propertyExpression, DatabaseArray value)

Set the given property to the given array

public DatabaseArray
Set (string propertyExpression, DateTime value)

Set the given property to the given datetime value

public DatabaseArray
Set (string propertyExpression, DatabaseObject value)

Set the given property to the given object

public DatabaseArray
Set (string propertyExpression, uint value)

Set the given property to the given uint value

public DatabaseArray
Set (int index, Byte[] value)

Set the value at the given index to the given byte array

public DatabaseArray
Set (int index, uint value)

Set the value at the given index to the given uint

public DatabaseArray
Set (int index, bool value)

Set the value at the given index to the given bool

public DatabaseArray
Set (int index, Double value)

Set the value at the given index to the given double

public DatabaseArray
Set (int index, Single value)

Set the value at the given index to the given float

public DatabaseArray
Set (int index, int value)

Set the value at the given index to the given int

public DatabaseArray
Set (string propertyExpression, string value)

Set the given property to the given string value

public DatabaseArray
Set (string propertyExpression, int value)

Set the given property to the given int value

public DatabaseArray
Set (int index, DateTime value)

Set the value at the given index to the given datetime

public DatabaseArray
Set (int index, string value)

Set the value at the given index to the given string

public DatabaseArray
Set (int index, DatabaseArray value)

Set the value at the given index to the given array

DatabaseArray.Count

public int
Count

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>
Indexes  [read-only]

Returns an enumerator that iterates over the indexes in this array that contain values.

DatabaseArray.IndexesAndValues

public IEnumerable<KeyValuePair<int, object>>
IndexesAndValues  [read-only]

Returns an enumerator that iterates over all the indexes and values in this array.

DatabaseArray.Add

public DatabaseArray
Add (Int64 value)

Add the given long value to the array

Arguments

Int64 value

DatabaseArray.Add

public DatabaseArray
Add (bool value)

Add the given bool value to the array

Arguments

bool value

DatabaseArray.Add

public DatabaseArray
Add (uint value)

Add the given uint value to the array

Arguments

uint value

DatabaseArray.Add

public DatabaseArray
Add (string value)

Add the given string value to the array

Arguments

string value

DatabaseArray.Add

public DatabaseArray
Add (int value)

Add the given int value to the array

Arguments

int value

DatabaseArray.Add

public DatabaseArray
Add (Single value)

Add the given float value to the array

Arguments

Single value

DatabaseArray.Add

public DatabaseArray
Add (DatabaseObject value)

Add the given object to the array

Arguments

DatabaseObject value

DatabaseArray.Add

public DatabaseArray
Add (DatabaseArray value)

Add the given array to the array

Arguments

DatabaseArray value

DatabaseArray.Add

public DatabaseArray
Add (DateTime value)

Add the given datetime value to the array

Arguments

DateTime value

DatabaseArray.Add

public DatabaseArray
Add (Double value)

Add the given double value to the array

Arguments

Double value

DatabaseArray.Add

public DatabaseArray
Add (Byte[] value)

Add the given byte array value to the array

Arguments

Byte[] value

DatabaseArray.Clear

public void
Clear ()

Remove all values from this array

DatabaseArray.Contains

public bool
Contains (string propertyExpression)

Returns true if the given property exists on this object

Arguments

string propertyExpression

DatabaseArray.Contains

public bool
Contains (int index)

Returns true if a value exists at the given index

Arguments

int index

DatabaseArray.GetArray

public DatabaseArray
GetArray (int index)

Get the array at the given index

Arguments

int index

DatabaseArray.GetArray

public DatabaseArray
GetArray (string propertyExpression)

Get the given array property

Arguments

string propertyExpression

DatabaseArray.GetBool

public bool
GetBool (int index)

Get the bool value at the given index

Arguments

int index

DatabaseArray.GetBool

public bool
GetBool (string propertyExpression)

Get the given bool property

Arguments

string propertyExpression

DatabaseArray.GetBool

public bool
GetBool (string propertyExpression, bool defaultValue)

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
GetBool (int index, bool defaultValue)

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[]
GetBytes (string propertyExpression)

Get the given byte array property

Arguments

string propertyExpression

DatabaseArray.GetBytes

public Byte[]
GetBytes (string propertyExpression, Byte[] defaultValue)

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[]
GetBytes (int index)

Get the byte array value at the given index

Arguments

int index

DatabaseArray.GetBytes

public Byte[]
GetBytes (int index, Byte[] defaultValue)

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
GetDateTime (string propertyExpression)

Get the given datetime property

Arguments

string propertyExpression

DatabaseArray.GetDateTime

public DateTime
GetDateTime (int index)

Get the datetime value at the given index

Arguments

int index

DatabaseArray.GetDateTime

public DateTime
GetDateTime (int index, DateTime defaultValue)

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
GetDateTime (string propertyExpression, DateTime defaultValue)

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
GetDouble (int index)

Get the double value at the given index

Arguments

int index

DatabaseArray.GetDouble

public Double
GetDouble (int index, Double defaultValue)

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
GetDouble (string propertyExpression)

Get the given double property

Arguments

string propertyExpression

DatabaseArray.GetDouble

public Double
GetDouble (string propertyExpression, Double defaultValue)

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
GetFloat (string propertyExpression, Single defaultValue)

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
GetFloat (string propertyExpression)

Get the given float property

Arguments

string propertyExpression

DatabaseArray.GetFloat

public Single
GetFloat (int index)

Get the float value at the given index

Arguments

int index

DatabaseArray.GetFloat

public Single
GetFloat (int index, Single defaultValue)

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
GetInt (string propertyExpression, int defaultValue)

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
GetInt (string propertyExpression)

Get the given int property

Arguments

string propertyExpression

DatabaseArray.GetInt

public int
GetInt (int index, int defaultValue)

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
GetInt (int index)

Get the int value at the given index

Arguments

int index

DatabaseArray.GetLong

public Int64
GetLong (int index, Int64 defaultValue)

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
GetLong (int index)

Get the long value at the given index

Arguments

int index

DatabaseArray.GetLong

public Int64
GetLong (string propertyExpression, Int64 defaultValue)

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
GetLong (string propertyExpression)

Get the given long property

Arguments

string propertyExpression

DatabaseArray.GetObject

public DatabaseObject
GetObject (int index)

Get the object at the given index

Arguments

int index

DatabaseArray.GetObject

public DatabaseObject
GetObject (string propertyExpression)

Get the given object property

Arguments

string propertyExpression

DatabaseArray.GetString

public string
GetString (string propertyExpression)

Get the given string property

Arguments

string propertyExpression

DatabaseArray.GetString

public string
GetString (int index)

Get the string value at the given index

Arguments

int index

DatabaseArray.GetString

public string
GetString (int index, string defaultValue)

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
GetString (string propertyExpression, string defaultValue)

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
GetUInt (string propertyExpression)

Get the given uint property

Arguments

string propertyExpression

DatabaseArray.GetUInt

public uint
GetUInt (string propertyExpression, uint defaultValue)

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
GetUInt (int index)

Get the uint value at the given index

Arguments

int index

DatabaseArray.GetUInt

public uint
GetUInt (int index, uint defaultValue)

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
GetValue (string propertyExpression)

Get the given property as an object

Arguments

string propertyExpression

DatabaseArray.GetValue

public object
GetValue (int index)

Get the value at the given index as an object

Arguments

int index

DatabaseArray.Insert

public DatabaseArray
Insert (int index, Byte[] value)

Insert the given byte array value at the given index

Arguments

int index
Byte[] value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, DateTime value)

Insert the given datetime value at the given index

Arguments

int index
DateTime value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, Int64 value)

Insert the given long value at the given index

Arguments

int index
Int64 value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, Single value)

Insert the given float value at the given index

Arguments

int index
Single value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, Double value)

Insert the given double value at the given index

Arguments

int index
Double value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, bool value)

Insert the given bool value at the given index

Arguments

int index
bool value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, DatabaseObject value)

Insert the given object at the given index

Arguments

int index
DatabaseObject value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, string value)

Insert the given string value at the given index

Arguments

int index
string value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, int value)

Insert the given int value at the given index

Arguments

int index
int value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, DatabaseArray value)

Insert the given array at the given index

Arguments

int index
DatabaseArray value

DatabaseArray.Insert

public DatabaseArray
Insert (int index, uint value)

Insert the given uint value at the given index

Arguments

int index
uint value

DatabaseArray.Remove

public DatabaseArray
Remove (string propertyExpression)

Removes the value of the given property from this object

Arguments

string propertyExpression

DatabaseArray.RemoveAt

public void
RemoveAt (int index)

Remove the value at the given index

Arguments

int index

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, Double value)

Set the given property to the given double value

Arguments

string propertyExpression
Double value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, Byte[] value)

Set the given property to the given byte array value

Arguments

string propertyExpression
Byte[] value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, Single value)

Set the given property to the given float value

Arguments

string propertyExpression
Single value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, Int64 value)

Set the given property to the given long value

Arguments

string propertyExpression
Int64 value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, bool value)

Set the given property to the given bool value

Arguments

string propertyExpression
bool value

DatabaseArray.Set

public DatabaseArray
Set (int index, DatabaseObject value)

Set the value at the given index to the given object

Arguments

int index
DatabaseObject value

DatabaseArray.Set

public DatabaseArray
Set (int index, Int64 value)

Set the value at the given index to the given long

Arguments

int index
Int64 value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, DatabaseArray value)

Set the given property to the given array

Arguments

string propertyExpression
DatabaseArray value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, DateTime value)

Set the given property to the given datetime value

Arguments

string propertyExpression
DateTime value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, DatabaseObject value)

Set the given property to the given object

Arguments

string propertyExpression
DatabaseObject value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, uint value)

Set the given property to the given uint value

Arguments

string propertyExpression
uint value

DatabaseArray.Set

public DatabaseArray
Set (int index, Byte[] value)

Set the value at the given index to the given byte array

Arguments

int index
Byte[] value

DatabaseArray.Set

public DatabaseArray
Set (int index, uint value)

Set the value at the given index to the given uint

Arguments

int index
uint value

DatabaseArray.Set

public DatabaseArray
Set (int index, bool value)

Set the value at the given index to the given bool

Arguments

int index
bool value

DatabaseArray.Set

public DatabaseArray
Set (int index, Double value)

Set the value at the given index to the given double

Arguments

int index
Double value

DatabaseArray.Set

public DatabaseArray
Set (int index, Single value)

Set the value at the given index to the given float

Arguments

int index
Single value

DatabaseArray.Set

public DatabaseArray
Set (int index, int value)

Set the value at the given index to the given int

Arguments

int index
int value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, string value)

Set the given property to the given string value

Arguments

string propertyExpression
string value

DatabaseArray.Set

public DatabaseArray
Set (string propertyExpression, int value)

Set the given property to the given int value

Arguments

string propertyExpression
int value

DatabaseArray.Set

public DatabaseArray
Set (int index, DateTime value)

Set the value at the given index to the given datetime

Arguments

int index
DateTime value

DatabaseArray.Set

public DatabaseArray
Set (int index, string value)

Set the value at the given index to the given string

Arguments

int index
string value

DatabaseArray.Set

public DatabaseArray
Set (int index, DatabaseArray value)

Set the value at the given index to the given array

Arguments

int index
DatabaseArray value