/// Return scores generated with a method based on the string given
///
/// # Methods
/// * `std` or `standard`: use std()
/// * `d20` or `1d20`: use d20()
/// * `4d6` or `3d6`: use lowest3_4d6()
Return scores generated with a method based on the string given
Return scores generated with a method based on the string given
pub fn from<S: ToString>(method: S) -> Result<Self, ()> {
        let m = method.to_string();
        if (m == "std") || (m == "standard") {
            Ok(Self::std())
        } else if (m == "d20") || (m == "1d20") {
            Ok(Self::d20())
        } else if (m == "4d6") || (m == "3d6") {
            Ok(Self::lowest3_4d6())
        } else {
            Err(())
        }
    }
pub fn from < S : ToString > ( method : S ) -> Result < Self , ( ) > { let m = method . to_string ( ) ; if ( m == " " ) || ( m == " " ) { Ok ( Self :: std ( ) ) } else if ( m == " " ) || ( m == " " ) { Ok ( Self :: d20 ( ) ) } else if ( m == " " ) || ( m == " " ) { Ok ( Self :: lowest3_4d6 ( ) ) } else { Err ( ( ) ) } }
Return scores generated with a method based on the string given
Return scores generated with a method based on the string given
method
S
methods
None