about summary refs log tree commit diff
path: root/src/Xanthous/Entities.hs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-09-20T23·38-0400
committerGriffin Smith <root@gws.fyi>2019-09-20T23·38-0400
commitdd1616666593f65bab70f1363b5d040fe5edd054 (patch)
tree4009c7004ad2becd2b316c9212a8c778a8c646ce /src/Xanthous/Entities.hs
parent4db3a68efec079bdb8723f377929bfa05860bdc2 (diff)
Describe what you see when you walk over items
Every step the character takes, describe the entities at that position
excluding the character.
Diffstat (limited to 'src/Xanthous/Entities.hs')
-rw-r--r--src/Xanthous/Entities.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Xanthous/Entities.hs b/src/Xanthous/Entities.hs
index e47e820f27ab..66a583f6b3fd 100644
--- a/src/Xanthous/Entities.hs
+++ b/src/Xanthous/Entities.hs
@@ -38,9 +38,11 @@ import           Xanthous.Orphans ()
 
 class (Show a, Eq a, Draw a) => Entity a where
   blocksVision :: a -> Bool
+  description :: a -> Text
 
 instance Entity a => Entity (Positioned a) where
   blocksVision (Positioned _ ent) = blocksVision ent
+  description (Positioned _ ent) = description ent
 
 --------------------------------------------------------------------------------
 data SomeEntity where
@@ -59,6 +61,7 @@ instance Draw SomeEntity where
 
 instance Entity SomeEntity where
   blocksVision (SomeEntity ent) = blocksVision ent
+  description (SomeEntity ent) = description ent
 
 downcastEntity :: (Entity a, Typeable a) => SomeEntity -> Maybe a
 downcastEntity (SomeEntity e) = cast e