summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Gay <eapoems@riseup.net>2023-10-02 03:07:44 -0400
committerDavid Gay <eapoems@riseup.net>2023-10-02 03:07:44 -0400
commit212abf5f02245b08de3ae13d84a18a71dd7dc7fc (patch)
tree77a885992fe26477f4d7722425c4adb52050fd41 /src
parentf67e624dc3e122a1574726e4dfc2cb077dcefe38 (diff)
Couple comments
Diffstat (limited to 'src')
-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)> {