[−][src]Struct dsa::commands::Roll
Methods
impl Roll
[src]
pub fn new_action() -> Box<dyn Action>
[src]
Trait Implementations
impl Action for Roll
[src]
Rolls the dice for a certain skill of the Hero, supports modifiers.
Examples
let mut roll = Roll::new_action(); hero.qualities.extend( vec![ (Agility,1), (Dexterity,2), (Strength,3), ] ); hero.skills.insert("bogen".to_string(),(4,[Agility,Dexterity,Strength])); let matches = roll.usage().get_matches_from(&["roll","-m","-5","--mod","3","bogen"]); let output = roll.call(&hero,&matches).unwrap(); assert_eq!(1,output.len()); if let Output::Roll { base, stat, mods, .. } = &output[0] { assert_eq!(4, *base); assert_eq!(&[1,2,3], stat); assert_eq!(-2, *mods); }
Auto Trait Implementations
impl RefUnwindSafe for Roll
impl Send for Roll
impl Sync for Roll
impl Unpin for Roll
impl UnwindSafe for Roll
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,