#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ModSettingValue {
pub value: crate::LuaAny,
}
pub static UNIT_MOD_SETTING: ModSettingValue = ModSettingValue {
value: crate::LuaAny,
};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct SettingsDictionary;
impl SettingsDictionary {
#[must_use]
pub const fn get_bool(self, _name: &'static str) -> bool {
false
}
#[must_use]
pub const fn get_int(self, _name: &'static str) -> i64 {
0
}
#[must_use]
pub const fn get_double(self, _name: &'static str) -> f64 {
0.0
}
#[must_use]
pub const fn get_string(self, _name: &'static str) -> &'static str {
""
}
#[must_use]
pub const fn get<T: crate::SettingValue>(self, _name: &'static str) -> T {
T::STUB
}
#[must_use]
pub fn setting(self, _name: &'static str) -> ModSettingValue {
UNIT_MOD_SETTING
}
}
impl std::ops::Index<&str> for SettingsDictionary {
type Output = ModSettingValue;
fn index(&self, _key: &str) -> &ModSettingValue {
&UNIT_MOD_SETTING
}
}
pub struct SettingTable {
pub startup: SettingsDictionary,
pub global: SettingsDictionary,
pub player_default: SettingsDictionary,
}
pub const settings: SettingTable = SettingTable {
startup: SettingsDictionary,
global: SettingsDictionary,
player_default: SettingsDictionary,
};
pub struct LuaDataInterface;
impl LuaDataInterface {
#[allow(unused_variables)]
pub fn extend<T, I: IntoIterator<Item = T>>(&self, items: I) {}
}
pub static data: LuaDataInterface = LuaDataInterface;
pub struct BoolSetting {
pub name: &'static str,
pub setting_type: &'static str,
pub default_value: bool,
}
pub struct IntSetting {
pub name: &'static str,
pub setting_type: &'static str,
pub default_value: i64,
pub minimum_value: Option<i64>,
pub maximum_value: Option<i64>,
}
pub struct DoubleSetting {
pub name: &'static str,
pub setting_type: &'static str,
pub default_value: f64,
pub minimum_value: Option<f64>,
pub maximum_value: Option<f64>,
}
pub struct StringSetting {
pub name: &'static str,
pub setting_type: &'static str,
pub default_value: &'static str,
pub hidden: bool,
}