summaryrefslogtreecommitdiff
path: root/src/random_tables.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/random_tables.rs')
-rw-r--r--src/random_tables.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/random_tables.rs b/src/random_tables.rs
index 2428ad2..e0512f0 100644
--- a/src/random_tables.rs
+++ b/src/random_tables.rs
@@ -41,6 +41,13 @@ impl RandomTables {
Ok(RandomTables { tables })
}
+ /// Rolls on a given random table.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// random_tables::roll_table("npc_alignment");
+ /// ```
pub fn roll_table(&self, table_name: &str) -> String {
let random_table = self.tables.get(table_name);
if let Some(table) = random_table {
@@ -72,6 +79,7 @@ impl RandomTables {
String::new()
}
+ /// Parses a roll string in the random tables yaml.
// TODO: Add validator somewhere that ensures all possible rolls are
// covered by the YAML, and that none overlap.
fn parse_roll(roll: &str) -> Option<(u32, u32)> {