factorio-prototypes-json 0.1.0

Rust types that parse Factorio's Prototype JSON Format.
Documentation
//! [`CustomProperties`] is a special set of properties that the user can add an arbitrary number of.

use serde::{Deserialize, Serialize};

use super::image::Image;
use super::types::Type;

/// A special set of properties that the user can add an arbitrary number of.
///
/// Specifies the type of the key and value of the custom property.
#[derive(Serialize, Deserialize, Debug)]
pub struct CustomProperties {
    /// The text description of the property.
    pub description: String,

    /// A list of Markdown lists to provide additional information. Usually contained in a spoiler tag.
    pub lists: Option<Vec<String>>,

    /// A list of code-only examples about the property.
    pub examples: Option<Vec<String>>,

    /// A list of illustrative images shown next to the property.
    pub images: Option<Vec<Image>>,

    /// The type of the key of the custom property.
    pub key_type: Type,

    /// The type of the value of the custom property.
    pub value_type: Type,
}