get

operator fun get(index: Int): CumulusCloud(source)

Returns the cloud in the collection at the specified index. Indices are zero-based and increase as clouds are added. Removing a cloud shifts all clouds after it to the left, changing their indices. This function is commonly used with CloudCollection.length to iterate over all the clouds in the collection.

// Toggle the show property of every cloud in the collection
const len = clouds.length;
for (let i = 0; i < len; ++i) {
const c = clouds.get(i);
c.show = !c.show;
}

Return

The cloud at the specified index.

Parameters

index

The zero-based index of the cloud.

See also