TwoDCartesianZoneStruct

struct TwoDCartesianZoneStruct

Encodes 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
  • use

    A ZoneUseEnum value representing the purpose of the zone.

    Declaration

  • A list of vertices of type TwoDCartesianVertexStruct. These vertices define a simple polygon on the TwoD Cartesian plane, which represents the bounds of the TwoD Cartesian Zone with an implicit connection between the last and first list items.

    Declaration

  • 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.parseError when parsing fails.

    Declaration

    Swift

    init(decoder: TraitDecoder) throws

    Parameters

    decoder

    The raw data representing this Struct.

  • Writes this Struct to the given TraitEncoder. Throws HomeError.parseError if 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)?