about summary refs log tree commit diff
path: root/users/grfn/xanthous/src/Xanthous/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'users/grfn/xanthous/src/Xanthous/Entities')
-rw-r--r--users/grfn/xanthous/src/Xanthous/Entities/Item.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/Entities/Item.hs b/users/grfn/xanthous/src/Xanthous/Entities/Item.hs
index 6647c42731fa..eadd62569663 100644
--- a/users/grfn/xanthous/src/Xanthous/Entities/Item.hs
+++ b/users/grfn/xanthous/src/Xanthous/Entities/Item.hs
@@ -10,6 +10,7 @@ module Xanthous.Entities.Item
   , newWithType
   , isEdible
   , weight
+  , fullDescription
   ) where
 --------------------------------------------------------------------------------
 import           Xanthous.Prelude
@@ -61,3 +62,15 @@ isEdible = Raw.isEdible . view itemType
 -- density of its material
 weight :: Item -> Grams
 weight item = (item ^. density) |*| (item ^. volume)
+
+-- | Describe the item in full detail
+fullDescription :: Item -> Text
+fullDescription item = unlines
+  [ item ^. itemType . Raw.description
+  , ""
+  , item ^. itemType . Raw.longDescription
+  , ""
+  , "volume: " <> tshow (item ^. volume)
+  , "density: " <> tshow (item ^. density)
+  , "weight: " <> tshow (weight item)
+  ]