sword_core/config.rs
1use crate::State;
2
3pub use thisconfig::{ByteConfig, Config, ConfigItem, ConfigSourceInfo, TimeConfig};
4
5/// A struct that holds a function to register a config type.
6/// Used by the inventory system to collect all config types at compile time.
7pub struct ConfigRegistrar {
8 pub register: fn(&State, &Config) -> (),
9}
10
11impl ConfigRegistrar {
12 pub const fn new(register: fn(&State, &Config) -> ()) -> Self {
13 Self { register }
14 }
15}
16
17inventory::collect!(ConfigRegistrar);