diff options
author | Griffin Smith <root@gws.fyi> | 2019-08-03T19·59-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-08-04T00·31-0400 |
commit | 48fb3f6624b95e9b18a5ff0a814573445c6bc2ab (patch) | |
tree | 441a8f04c3e64fd8e3559bab85bab8e0b45789ff /src/display/color.rs | |
parent | 82cefedab9e44b48f4d3cc08b0f6e002ae383c9d (diff) |
Add inventory, and the ability to pick up items
Add inventory as a basic vector of items attached to the character, and the ability to pick up a single item where the character stands
Diffstat (limited to 'src/display/color.rs')
-rw-r--r-- | src/display/color.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/display/color.rs b/src/display/color.rs index b1e799c5ed9f..afe0039998b8 100644 --- a/src/display/color.rs +++ b/src/display/color.rs @@ -15,6 +15,15 @@ impl Color { } } +impl PartialEq for Color { + fn eq(&self, other: &Self) -> bool { + format!("{}{}", color::Fg(self), color::Bg(self)) + == format!("{}{}", color::Fg(other), color::Bg(other)) + } +} + +impl Eq for Color {} + impl color::Color for Color { fn write_fg(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.write_fg(f) |