propertycollection - TogetherGames/Public-Corona-Lua GitHub Wiki

PropertyCollection

Together::PropertyCollection

Overview

The PropertyCollection class contains a list of TogetherProperties and additional child PropertyCollections.


Members

string Name

The name of this collection node.

table Properties

A list of TogetherProperties.

table Children

A list of children PropertyCollections.


Methods


New()

Creates a new PropertyCollection object

Syntax
PropertyCollection:New(  )

FindProperty()

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

Syntax
PropertyCollection:FindProperty( propertyName )
Parameters

string propertyName

The name of the property to find

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

Get()

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

Returns string
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 find

[string](#) defaultValue

The value to be returned when the property is not found

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

Set()

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

Syntax
PropertyCollection:Set( propertyName, propertyValue )
Parameters

string propertyName

The name of the property to set or create

[string](#) propertyValue

The value to set for the property

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

HasProperty()

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

Returns boolean
Syntax
PropertyCollection:HasProperty( propertyName )
Parameters

string propertyName

The name of the property to check for

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

GetCount()

Returns the number of properties in the collection. This does not include children collections.

Returns number
Syntax
PropertyCollection:GetCount(  )

GetAt()

Gets the property at the specified index.

Syntax
PropertyCollection:GetAt( index )
Parameters

number index

The index to return from the collection

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