propertycollection - TogetherGames/Public-Unity-CSharp GitHub Wiki

PropertyCollection

Together::PropertyCollection

Overview

The PropertyCollection class contains a list of properties and sub property collections.


Members

string Name

The name of the property collection.

List<> Properties

Stores all the Properties contained in this PropertyCollection.

List<> Children

Stores all the sub PropertyCollections contained in this PropertyCollection.


Methods


Get()

Gets the property with the specified name if it exists, otherwise returns null.

Returns Property
Syntax
PropertyCollection.Get( propertyName )
Parameters

string propertyName

The name of the property to find

--------------------------------------------------------------------------------

GetEx()

Gets the value of the property with the specified name if it exists, otherwise this will create the new property with the default value and return that value.

Returns string
Syntax
PropertyCollection.GetEx( propertyName, defaultValue )
Parameters

string propertyName

The name of the property to get.

[string](#) defaultValue

The value to return if the property doesn't exist.

--------------------------------------------------------------------------------

Set()

Sets the value of the property with the specified name if it exists, otherwise creates it with the set value.

Returns Property
Syntax
PropertyCollection.Set( propertyName, propertyValue )
Parameters

string propertyName

The name of the property to set

[string](#) propertyValue

The value to set the property to

--------------------------------------------------------------------------------

HasProperty()

Checks to see whether a property with the specified name exists.

Returns bool
Syntax
PropertyCollection.HasProperty( propertyName )
Parameters

string propertyName

The name of the property to check.

--------------------------------------------------------------------------------

EncodeJson()

Encodes the collection to a json string.

Returns string
Syntax
PropertyCollection.EncodeJson(  )

⚠️ **GitHub.com Fallback** ⚠️