refactors beatitude, and prepping readme for week 7

This commit is contained in:
Llywelwyn 2023-08-21 12:50:30 +01:00
parent 469d83994e
commit 831720ce37
14 changed files with 172 additions and 63 deletions

View file

@ -1,4 +1,5 @@
use super::{append_entry, LogFragment};
use crate::BUC;
use rltk::prelude::*;
pub struct Logger {
@ -39,10 +40,10 @@ impl Logger {
return self;
}
pub fn buc<T: ToString>(mut self, buc: i32, cursed: Option<T>, blessed: Option<T>) -> Self {
if buc == crate::effects::CURSED && cursed.is_some() {
pub fn buc<T: ToString>(mut self, buc: BUC, cursed: Option<T>, blessed: Option<T>) -> Self {
if buc == BUC::Cursed && cursed.is_some() {
self.fragments.push(LogFragment { colour: RGB::named(RED), text: cursed.unwrap().to_string() });
} else if buc == crate::effects::BLESSED && blessed.is_some() {
} else if buc == BUC::Blessed && blessed.is_some() {
self.fragments.push(LogFragment { colour: RGB::named(GOLD), text: blessed.unwrap().to_string() });
}
return self;