use bevy_reflect::prelude::*;
use std::hash::Hash;
#[derive(Reflect, Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub enum ConfigValueType {
#[default]
None,
IntRange(i64, i64),
UintRange(u64, u64),
FloatRange(f64, f64),
Selection(Vec<String>),
}
impl Eq for ConfigValueType {}
#[derive(Reflect, Debug, Clone, PartialEq, Eq)]
pub struct ConfigKey {
pub id: String,
pub name: String,
pub value_type: ConfigValueType,
pub default_value: ConfigValue,
pub description: Option<String>,
pub category: Option<String>,
pub is_hidden: bool,
pub is_read_only: bool,
pub is_restart_required: bool,
}
impl Hash for ConfigKey {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.id.hash(state);
}
}
#[derive(Reflect, Debug, Clone, PartialEq)]
pub enum ConfigValue {
Bool(bool),
Int(i64),
Uint(u64),
Float(f64),
String(String),
}
impl Eq for ConfigValue {}