This commit is contained in:
Llywelwyn 2023-07-10 12:48:56 +01:00
parent 85881db62f
commit 4f899d329e
9 changed files with 121 additions and 67 deletions

View file

@ -22,6 +22,21 @@ impl Logger {
}
pub fn log(self) {
append_entry(self.fragments)
return append_entry(self.fragments);
}
pub fn npc_name<T: ToString>(mut self, text: T) -> Self {
self.fragments.push(LogFragment { colour: RGB::named(rltk::YELLOW), text: text.to_string() });
return self;
}
pub fn item_name<T: ToString>(mut self, text: T) -> Self {
self.fragments.push(LogFragment { colour: RGB::named(rltk::CYAN), text: text.to_string() });
return self;
}
pub fn damage(mut self, damage: i32) -> Self {
self.fragments.push(LogFragment { colour: RGB::named(rltk::RED), text: format!("{}", damage).to_string() });
return self;
}
}