mln-rs-style 0.0.21

Part of mln-rs, a MapLibre map renderer written in Rust. Depend on mln-rs instead.
Documentation
// This file is generated by //tools/style-codegen from the style spec
// (tools/style-codegen/v8.json). Do not edit.

use crate::property::table::{Properties, PropertyInfo, PropertyTable, PropertyVisitor};
use crate::sky::Sky;

/// The properties, by slot.
pub(crate) static PROPERTIES: PropertyTable = PropertyTable::new(
    &[
        PropertyInfo::paint("sky-color"),
        PropertyInfo::paint("horizon-color"),
        PropertyInfo::paint("fog-color"),
        PropertyInfo::paint("fog-ground-blend"),
        PropertyInfo::paint("horizon-fog-blend"),
        PropertyInfo::paint("sky-horizon-blend"),
        PropertyInfo::paint("atmosphere-blend"),
    ],
    &[6, 2, 3, 1, 4, 0, 5],
);

impl Properties for Sky {
    const TABLE: &'static PropertyTable = &PROPERTIES;

    fn visit<V: PropertyVisitor<Self>>(slot: usize, visitor: V) -> Option<V::Output> {
        Some(match slot {
            0 => visitor.paint(|s| &s.properties.sky_color, |s| &mut s.properties.sky_color),
            1 => visitor.paint(|s| &s.properties.sky_horizon_color, |s| &mut s.properties.sky_horizon_color),
            2 => visitor.paint(|s| &s.properties.sky_fog_color, |s| &mut s.properties.sky_fog_color),
            3 => visitor.paint(|s| &s.properties.sky_fog_ground_blend, |s| &mut s.properties.sky_fog_ground_blend),
            4 => visitor.paint(|s| &s.properties.sky_horizon_fog_blend, |s| &mut s.properties.sky_horizon_fog_blend),
            5 => visitor.paint(|s| &s.properties.sky_horizon_blend, |s| &mut s.properties.sky_horizon_blend),
            6 => visitor.paint(|s| &s.properties.sky_atmosphere_blend, |s| &mut s.properties.sky_atmosphere_blend),
            _ => return None,
        })
    }
}