struct TwoDCartesianZoneStructEncodes all information needed to define a TwoDCartesianZone.
-
A string representing the name of the Zone. This is not guaranteed to be unique.
Declaration
Swift
let name: String -
A
ZoneUseEnumvalue representing the purpose of the zone.Declaration
Swift
let use: Matter.ZoneManagementTrait.ZoneUseEnum -
A list of vertices of type
TwoDCartesianVertexStruct. These vertices define a simple polygon on the TwoD Cartesian plane, which represents the bounds of theTwoD Cartesian Zonewith an implicit connection between the last and first list items.Declaration
Swift
let vertices: [Matter.ZoneManagementTrait.TwoDCartesianVertexStruct] -
The color, in RGB or RGBA, used for attaching a color to the zone definition. This value is informational only and has no effect on the behavior of the zone.
Declaration
Swift
let color: String? -
Creates a new Struct instance using data read from the given
TraitDecoder.Throws
HomeError.parseErrorwhen parsing fails.Declaration
Swift
init(decoder: TraitDecoder) throwsParameters
decoderThe raw data representing this Struct.
-
Writes this Struct to the given
TraitEncoder. ThrowsHomeError.parseErrorif the data could not be encoded.Declaration
Swift
func encode(with encoder: TraitEncoder) throws -
Returns the field corresponding to the given field ID.
Declaration
Swift
static func structField(id: UInt32) -> (any Field)?