Player.IO

Build fun, powerful & scalable online and mobile games with the reliable backend your users expect

Sign Up | Sign In

Multiplayer Reference

Multiplayer  class documentationClass 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
Count

Returns the number of values in this array. If set to a smaller number than the current count, it will truncate the 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 (string propertyExpression)

Get the given array property

public DatabaseArray
GetArray (int index)

Get the array at the given index

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)

Get the bool value at the given index

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

Get the given bool 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, 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 Byte[]
GetBytes (int index)

Get the byte array value at the given index

public Byte[]
GetBytes (string propertyExpression)

Get the given byte array property

public DateTime
GetDateTime (string propertyExpression)

Get the given datetime property

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

Get the double 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 Single
GetFloat (int index)

Get the float value at the given index

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

Get the given int property

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

Get the int value at the given index

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

Get the given long property

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

Get the long 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 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, string defaultValue)

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

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)

Get the given string property

public string
GetString (int index)

Get the string value at the given index

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

Get the given uint property

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

Get the uint value at the given index

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, Int64 value)

Insert the given long value 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, 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
Insert (int index, int value)

Insert the given int 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, DateTime value)

Insert the given datetime 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, Byte[] value)

Insert the given byte array 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
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, Single value)

Set the given property to the given float value

public DatabaseArray
Set (string propertyExpression, bool value)

Set the given property to the given bool value

public DatabaseArray
Set (string propertyExpression, Int64 value)

Set the given property to the given long value

public DatabaseArray
Set (string propertyExpression, int value)

Set the given property to the given int value

public DatabaseArray
Set (string propertyExpression, uint value)

Set the given property to the given uint value

public DatabaseArray
Set (string propertyExpression, Double value)

Set the given property to the given double value

public DatabaseArray
Set (string propertyExpression, DatabaseArray value)

Set the given property to the given array

public DatabaseArray
Set (int index, DateTime value)

Set the value at the given index to the given datetime

public DatabaseArray
Set (string propertyExpression, DatabaseObject value)

Set the given property to the given object

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

Set the given property to the given byte array value

public DatabaseArray
Set (string propertyExpression, DateTime value)

Set the given property to the given datetime value

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, Byte[] value)

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

public DatabaseArray
Set (int index, DatabaseArray value)

Set the value at the given index to the given array

public DatabaseArray
Set (int index, DatabaseObject value)

Set the value at the given index to the given object

public DatabaseArray
Set (int index, bool value)

Set the value at the given index to the given bool

public DatabaseArray
Set (int index, string value)

Set the value at the given index to the given string

public DatabaseArray
Set (string propertyExpression, string value)

Set the given property to the given string value

public DatabaseArray
Set (int index, int value)

Set the value at the given index to the given int

public DatabaseArray
Set (int index, Int64 value)

Set the value at the given index to the given long

public DatabaseArray
Set (int index, uint value)

Set the value at the given index to the given uint

Count

Returns the number of values in this array. If set to a smaller number than the current count, it will truncate the array.

Return Value

Add

Add the given long value to the array

Arguments

Int64 value

Return Value

DatabaseArray

Add

Add the given bool value to the array

Arguments

bool value

Return Value

DatabaseArray

Add

Add the given uint value to the array

Arguments

uint value

Return Value

DatabaseArray

Add

Add the given string value to the array

Arguments

string value

Return Value

DatabaseArray

Add

Add the given int value to the array

Arguments

int value

Return Value

DatabaseArray

Add

Add the given float value to the array

Arguments

Single value

Return Value

DatabaseArray

Add

Add the given object to the array

Arguments

DatabaseObject value

Return Value

DatabaseArray

Add

Add the given array to the array

Arguments

DatabaseArray value

Return Value

DatabaseArray

Add

Add the given datetime value to the array

Arguments

DateTime value

Return Value

DatabaseArray

Add

Add the given double value to the array

Arguments

Double value

Return Value

DatabaseArray

Add

Add the given byte array value to the array

Arguments

Byte[] value

Return Value

DatabaseArray

Clear

Remove all values from this array

Contains

Returns true if the given property exists on this object

Arguments

string propertyExpression

Return Value

bool

Contains

Returns true if a value exists at the given index

Arguments

int index

Return Value

bool

GetArray

Get the given array property

Arguments

string propertyExpression

Return Value

DatabaseArray

GetArray

Get the array at the given index

Arguments

int index

Return Value

DatabaseArray

GetBool

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

Arguments

string propertyExpression
bool defaultValue

Return Value

bool

GetBool

Get the bool value at the given index

Arguments

int index

Return Value

bool

GetBool

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

Return Value

bool

GetBool

Get the given bool property

Arguments

string propertyExpression

Return Value

bool

GetBytes

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

Return Value

Byte[]

GetBytes

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

Return Value

Byte[]

GetBytes

Get the byte array value at the given index

Arguments

int index

Return Value

Byte[]

GetBytes

Get the given byte array property

Arguments

string propertyExpression

Return Value

Byte[]

GetDateTime

Get the given datetime property

Arguments

string propertyExpression

Return Value

DateTime

GetDateTime

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

Arguments

string propertyExpression
DateTime defaultValue

Return Value

DateTime

GetDateTime

Get the datetime value at the given index

Arguments

int index

Return Value

DateTime

GetDateTime

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

Return Value

DateTime

GetDouble

Get the given double property

Arguments

string propertyExpression

Return Value

Double

GetDouble

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

Arguments

string propertyExpression
Double defaultValue

Return Value

Double

GetDouble

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

Return Value

Double

GetDouble

Get the double value at the given index

Arguments

int index

Return Value

Double

GetFloat

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

Return Value

Single

GetFloat

Get the float value at the given index

Arguments

int index

Return Value

Single

GetFloat

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

Arguments

string propertyExpression
Single defaultValue

Return Value

Single

GetFloat

Get the given float property

Arguments

string propertyExpression

Return Value

Single

GetInt

Get the given int property

Arguments

string propertyExpression

Return Value

int

GetInt

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

Arguments

string propertyExpression
int defaultValue

Return Value

int

GetInt

Get the int value at the given index

Arguments

int index

Return Value

int

GetInt

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

Return Value

int

GetLong

Get the given long property

Arguments

string propertyExpression

Return Value

Int64

GetLong

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

Arguments

string propertyExpression
Int64 defaultValue

Return Value

Int64

GetLong

Get the long value at the given index

Arguments

int index

Return Value

Int64

GetLong

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

Return Value

Int64

GetObject

Get the object at the given index

Arguments

int index

Return Value

DatabaseObject

GetObject

Get the given object property

Arguments

string propertyExpression

Return Value

DatabaseObject

GetString

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

Arguments

string propertyExpression
string defaultValue

Return Value

string

GetString

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

Return Value

string

GetString

Get the given string property

Arguments

string propertyExpression

Return Value

string

GetString

Get the string value at the given index

Arguments

int index

Return Value

string

GetUInt

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

Arguments

string propertyExpression
uint defaultValue

Return Value

uint

GetUInt

Get the given uint property

Arguments

string propertyExpression

Return Value

uint

GetUInt

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

Return Value

uint

GetUInt

Get the uint value at the given index

Arguments

int index

Return Value

uint

GetValue

Get the given property as an object

Arguments

string propertyExpression

Return Value

object

GetValue

Get the value at the given index as an object

Arguments

int index

Return Value

object

Insert

Insert the given long value at the given index

Arguments

int index
Int64 value

Return Value

DatabaseArray

Insert

Insert the given string value at the given index

Arguments

int index
string value

Return Value

DatabaseArray

Insert

Insert the given array at the given index

Arguments

int index
DatabaseArray value

Return Value

DatabaseArray

Insert

Insert the given uint value at the given index

Arguments

int index
uint value

Return Value

DatabaseArray

Insert

Insert the given int value at the given index

Arguments

int index
int value

Return Value

DatabaseArray

Insert

Insert the given bool value at the given index

Arguments

int index
bool value

Return Value

DatabaseArray

Insert

Insert the given datetime value at the given index

Arguments

int index
DateTime value

Return Value

DatabaseArray

Insert

Insert the given object at the given index

Arguments

int index
DatabaseObject value

Return Value

DatabaseArray

Insert

Insert the given byte array value at the given index

Arguments

int index
Byte[] value

Return Value

DatabaseArray

Insert

Insert the given float value at the given index

Arguments

int index
Single value

Return Value

DatabaseArray

Insert

Insert the given double value at the given index

Arguments

int index
Double value

Return Value

DatabaseArray

Remove

Removes the value of the given property from this object

Arguments

string propertyExpression

Return Value

DatabaseArray

RemoveAt

Remove the value at the given index

Arguments

int index

Set

Set the given property to the given float value

Arguments

string propertyExpression
Single value

Return Value

DatabaseArray

Set

Set the given property to the given bool value

Arguments

string propertyExpression
bool value

Return Value

DatabaseArray

Set

Set the given property to the given long value

Arguments

string propertyExpression
Int64 value

Return Value

DatabaseArray

Set

Set the given property to the given int value

Arguments

string propertyExpression
int value

Return Value

DatabaseArray

Set

Set the given property to the given uint value

Arguments

string propertyExpression
uint value

Return Value

DatabaseArray

Set

Set the given property to the given double value

Arguments

string propertyExpression
Double value

Return Value

DatabaseArray

Set

Set the given property to the given array

Arguments

string propertyExpression
DatabaseArray value

Return Value

DatabaseArray

Set

Set the value at the given index to the given datetime

Arguments

int index
DateTime value

Return Value

DatabaseArray

Set

Set the given property to the given object

Arguments

string propertyExpression
DatabaseObject value

Return Value

DatabaseArray

Set

Set the given property to the given byte array value

Arguments

string propertyExpression
Byte[] value

Return Value

DatabaseArray

Set

Set the given property to the given datetime value

Arguments

string propertyExpression
DateTime value

Return Value

DatabaseArray

Set

Set the value at the given index to the given double

Arguments

int index
Double value

Return Value

DatabaseArray

Set

Set the value at the given index to the given float

Arguments

int index
Single value

Return Value

DatabaseArray

Set

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

Arguments

int index
Byte[] value

Return Value

DatabaseArray

Set

Set the value at the given index to the given array

Arguments

int index
DatabaseArray value

Return Value

DatabaseArray

Set

Set the value at the given index to the given object

Arguments

int index
DatabaseObject value

Return Value

DatabaseArray

Set

Set the value at the given index to the given bool

Arguments

int index
bool value

Return Value

DatabaseArray

Set

Set the value at the given index to the given string

Arguments

int index
string value

Return Value

DatabaseArray

Set

Set the given property to the given string value

Arguments

string propertyExpression
string value

Return Value

DatabaseArray

Set

Set the value at the given index to the given int

Arguments

int index
int value

Return Value

DatabaseArray

Set

Set the value at the given index to the given long

Arguments

int index
Int64 value

Return Value

DatabaseArray

Set

Set the value at the given index to the given uint

Arguments

int index
uint value

Return Value

DatabaseArray