//! Options contains everything related to engine options. The idea behind this is to take as much //! advantage of the typechecker as possible. As a result, engine option names are constant static strings, //! and EngineOption tries to be flexible so it can be reused for each option, which also maintaining some //! of the nicer parts of typechecking. #[derive(Debug)] enum EngineOptionType { Check, Spin, Combo, Button, TypeString, // `String` is a reserved word so `TypeString` is substituted } #[derive(Debug)] enum EngineOptionDataType { DefaultVal, // `Default` is reserved so `DefaultVal` is used Min, Max, Var, } #[derive(Debug, PartialEq)] struct EngineOption { name: String, option_type: EngineOptionType, option_data: HashMap>, } impl PartialEq for EngineOption { pub fn eq(&self, other: EngineOption) { // TODO: Implement equality on the EngineOption struct and write tests for it. } } impl EngineOption { pub fn option_string(&self) -> String { // TODO: Implement this to save this when looping through and sending options // TODO: This should be tested in isolation as well // This should handle the case where optional min max var are specified as well. // pattern match the engine option type and convert it to the correct string. format!("PUT THE FULL COMMAND STRING HERE!"); } }