|
|
@ -4,6 +4,7 @@ |
|
|
|
//! of the nicer parts of typechecking.
|
|
|
|
//! of the nicer parts of typechecking.
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)] |
|
|
|
#[derive(Debug)] |
|
|
|
|
|
|
|
/// The `EngineOptionType` type used to indicate what type of option the GUI should display
|
|
|
|
enum EngineOptionType { |
|
|
|
enum EngineOptionType { |
|
|
|
Check, |
|
|
|
Check, |
|
|
|
Spin, |
|
|
|
Spin, |
|
|
@ -13,6 +14,7 @@ enum EngineOptionType { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)] |
|
|
|
#[derive(Debug)] |
|
|
|
|
|
|
|
/// The `EngineOptionDataType` type used to indicate the type of the `EngineOption` setting
|
|
|
|
enum EngineOptionDataType { |
|
|
|
enum EngineOptionDataType { |
|
|
|
DefaultVal, // `Default` is reserved so `DefaultVal` is used
|
|
|
|
DefaultVal, // `Default` is reserved so `DefaultVal` is used
|
|
|
|
Min, |
|
|
|
Min, |
|
|
@ -20,7 +22,15 @@ enum EngineOptionDataType { |
|
|
|
Var, |
|
|
|
Var, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)] |
|
|
|
|
|
|
|
/// The `EngineOptionDataValue` makes the data type generic so one `EngineOption` can represent everything
|
|
|
|
|
|
|
|
/// This would be set to the type of the engine option (ex. i32)
|
|
|
|
|
|
|
|
struct EngineOptionDataValue<T> { |
|
|
|
|
|
|
|
value: T, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq)] |
|
|
|
#[derive(Debug, PartialEq)] |
|
|
|
|
|
|
|
/// The `EngineOption` type is the overarching type representing a single configurable engine option
|
|
|
|
struct EngineOption<T> { |
|
|
|
struct EngineOption<T> { |
|
|
|
name: String, |
|
|
|
name: String, |
|
|
|
option_type: EngineOptionType, |
|
|
|
option_type: EngineOptionType, |
|
|
|