Skip to main content

ZoneList

The ZoneList class represents an ordered collection of Zone objects.

class ZoneList
info

This class cannot be instantiated directly. Instances are returned by Group.zones.

Properties

length

length: Int { get }

The number of zones in the list.

Methods

at

at(index: Int) -> (Zone) [subscript]

Returns the Zone at the given index. Throws an error if the index is out of range.

While at can be called as a regular method, it also enables the subscript operator, so both forms are equivalent:

var zone = zone_list.at(0)
var zone = zone_list[0]

iterator

iterator() -> (ZoneListIterator)

Returns a ZoneListIterator for iterating over all zones in the list. In practice, you will rarely need to call this method directly. Its main purpose is to enable the for-in loop syntax:

for zone in zone_list {
// ...
}