summaryrefslogtreecommitdiff
path: root/src/random_tables.rs
diff options
context:
space:
mode:
authorDavid Gay <eapoems@riseup.net>2023-10-14 18:44:13 -0400
committerDavid Gay <eapoems@riseup.net>2023-10-14 18:44:13 -0400
commitc220702eef49d1762b91502f1dbf486e1fc81d0c (patch)
treefe56f0ad986bafe950a2c6830bd50ccb5fcd018d /src/random_tables.rs
parentf585f5db852a34e2a6089bd460e7c68b8833ca4a (diff)
Improve class data loading
Diffstat (limited to 'src/random_tables.rs')
-rw-r--r--src/random_tables.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/random_tables.rs b/src/random_tables.rs
index 07f0022..4411675 100644
--- a/src/random_tables.rs
+++ b/src/random_tables.rs
@@ -1,5 +1,5 @@
use crate::dice;
-use crate::rules::classes::Classes;
+use crate::rules::classes::CLASSES;
use include_dir::{include_dir, Dir};
use serde::Deserialize;
use serde_yaml;
@@ -71,9 +71,8 @@ impl RandomTables {
}
if let Some(class_string) = &step.class {
- let classes = Classes::new().unwrap();
let class =
- classes.class(class_string).expect("Failed to load class.");
+ CLASSES.get(class_string).expect("Failed to load class.");
output_text.push_str(&*class.name);
}