|
|
@ -4,6 +4,7 @@ |
|
|
|
//! of the nicer parts of typechecking.
|
|
|
|
//! of the nicer parts of typechecking.
|
|
|
|
|
|
|
|
|
|
|
|
use std::collections::HashMap; |
|
|
|
use std::collections::HashMap; |
|
|
|
|
|
|
|
use commands; |
|
|
|
|
|
|
|
|
|
|
|
pub mod constants { |
|
|
|
pub mod constants { |
|
|
|
|
|
|
|
|
|
|
@ -48,11 +49,11 @@ pub mod constants { |
|
|
|
/// The `EngineOptionType` type used to indicate what type of option the GUI should display
|
|
|
|
/// The `EngineOptionType` type used to indicate what type of option the GUI should display
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq)] |
|
|
|
#[derive(Copy, Clone, Debug, PartialEq)] |
|
|
|
pub enum EngineOptionType { |
|
|
|
pub enum EngineOptionType { |
|
|
|
Check, |
|
|
|
Check("check"), |
|
|
|
Spin, |
|
|
|
Spin("spin"), |
|
|
|
Combo, |
|
|
|
Combo("combo"), |
|
|
|
Button, |
|
|
|
Button("button"), |
|
|
|
TypeString, // `String` is a reserved word so `TypeString` is substituted
|
|
|
|
TypeString("string"), // `String` is a reserved word so `TypeString` is substituted
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq, PartialOrd)] |
|
|
|
#[derive(Clone, Debug, PartialEq, PartialOrd)] |
|
|
@ -67,10 +68,10 @@ pub enum EngineOptionData { |
|
|
|
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] |
|
|
|
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] |
|
|
|
/// The `EngineOptionDataType` type used to indicate the type of the `EngineOption` setting
|
|
|
|
/// The `EngineOptionDataType` type used to indicate the type of the `EngineOption` setting
|
|
|
|
pub enum EngineOptionDataType { |
|
|
|
pub enum EngineOptionDataType { |
|
|
|
DefaultVal, // `Default` is reserved so `DefaultVal` is used
|
|
|
|
DefaultVal("default"), // `Default` is reserved so `DefaultVal` is used
|
|
|
|
Min, |
|
|
|
Min("min"), |
|
|
|
Max, |
|
|
|
Max("max"), |
|
|
|
Var, |
|
|
|
Var("var"), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq)] |
|
|
|
#[derive(Debug, PartialEq)] |
|
|
@ -90,12 +91,14 @@ impl EngineOption { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn option_string(&self) -> String { |
|
|
|
pub fn option_string(&self) -> String { |
|
|
|
// TODO: Implement this to save this when looping through and sending options
|
|
|
|
let option_data_string: String; |
|
|
|
// TODO: This should be tested in isolation as well
|
|
|
|
|
|
|
|
// This should handle the case where optional min max var are specified as well.
|
|
|
|
for dt, eod in &self.option_data { |
|
|
|
// pattern match the engine option type and convert it to the correct string.
|
|
|
|
option_data_string = option_data_string + format!("{} {}", dt, eod); |
|
|
|
// EVERYTHING SHOULD BE TRIVIALLY CASTABLE INTO A STRING
|
|
|
|
} |
|
|
|
// NO MATCHING NEEDED....PROBABLY
|
|
|
|
|
|
|
|
format!("PUT THE FULL COMMAND STRING HERE!") |
|
|
|
|
|
|
|
|
|
|
|
format!("{} {} {} {} {} {}\n", commands::OPTION, commands::OPTIONNAME, self.name, |
|
|
|
|
|
|
|
commands::TYPE, option_type, option_data_string); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|