Skip to content

Commit

Permalink
Add Dice::plain method
Browse files Browse the repository at this point in the history
  • Loading branch information
Gawdl3y committed Mar 12, 2024
1 parent a7e6acb commit 1d06371
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/dice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ impl Dice {
DieRoll::new_rand_using_rng(self.sides, rng)
}

/// Gets a new set of Dice matching this one but without any modifiers
pub fn plain(&self) -> Self {
Dice {
count: self.count,
sides: self.sides,
modifiers: Vec::new(),
}
}

/// Creates a new set of dice with a given count and number of sides
pub fn new(count: u8, sides: u8) -> Self {
Self {
Expand Down

0 comments on commit 1d06371

Please sign in to comment.