about summary refs log tree commit diff
path: root/src/Xanthous/Game
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xanthous/Game')
-rw-r--r--src/Xanthous/Game/State.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Xanthous/Game/State.hs b/src/Xanthous/Game/State.hs
index e5ee66deac45..5c9130de386a 100644
--- a/src/Xanthous/Game/State.hs
+++ b/src/Xanthous/Game/State.hs
@@ -295,6 +295,7 @@ instance
 
 class Brain a where
   step :: Ticks -> Positioned a -> AppM (Positioned a)
+  -- | Does this entity ever move on its own?
   entityCanMove :: a -> Bool
   entityCanMove = const False
 
@@ -326,6 +327,12 @@ class ( Show a, Eq a, Ord a, NFData a
       , Draw a, Brain a
       ) => Entity a where
   blocksVision :: a -> Bool
+
+  -- | Does this entity block a large object from being put in the same tile as
+  -- it - eg a a door being closed on it
+  blocksObject :: a -> Bool
+  blocksObject = const False
+
   description :: a -> Text
   entityChar :: a -> EntityChar
   entityCollision :: a -> Maybe Collision
@@ -368,6 +375,7 @@ instance Draw SomeEntity where
 instance Brain SomeEntity where
   step ticks (Positioned p (SomeEntity ent)) =
     fmap SomeEntity <$> step ticks (Positioned p ent)
+  entityCanMove (SomeEntity ent) = entityCanMove ent
 
 downcastEntity :: forall (a :: Type). (Typeable a) => SomeEntity -> Maybe a
 downcastEntity (SomeEntity e) = cast e