From 212abf5f02245b08de3ae13d84a18a71dd7dc7fc Mon Sep 17 00:00:00 2001 From: David Gay Date: Mon, 2 Oct 2023 03:07:44 -0400 Subject: Couple comments --- src/random_tables.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/random_tables.rs') 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)> { -- cgit v1.2.3