about summary refs log tree commit diff
path: root/src/Xanthous/Entities/Environment.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xanthous/Entities/Environment.hs')
-rw-r--r--src/Xanthous/Entities/Environment.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Xanthous/Entities/Environment.hs b/src/Xanthous/Entities/Environment.hs
index 4ef67a577dbb..e8190cd42a92 100644
--- a/src/Xanthous/Entities/Environment.hs
+++ b/src/Xanthous/Entities/Environment.hs
@@ -13,7 +13,15 @@ import Brick (str)
 import Brick.Widgets.Border.Style (unicode)
 import Brick.Types (Edges(..))
 --------------------------------------------------------------------------------
-import Xanthous.Entities (Draw(..), entityIs, Entity(..), SomeEntity)
+import Xanthous.Entities
+       ( Draw(..)
+       , entityIs
+       , Entity(..)
+       , SomeEntity
+       , Brain(..)
+       , Brainless(..)
+       , brainVia
+       )
 import Xanthous.Entities.Draw.Util
 import Xanthous.Data
 --------------------------------------------------------------------------------
@@ -22,6 +30,9 @@ data Wall = Wall
   deriving stock (Show, Eq, Ord, Generic, Enum)
   deriving anyclass (CoArbitrary, Function)
 
+-- deriving via Brainless Wall instance Brain Wall
+instance Brain Wall where step = brainVia Brainless
+
 instance Entity Wall where
   blocksVision _ = True
   description _ = "a wall"
@@ -64,6 +75,9 @@ instance Draw Door where
       horizDoor = '␣'
       vertDoor = '['
 
+-- deriving via Brainless Door instance Brain Door
+instance Brain Door where step = brainVia Brainless
+
 instance Entity Door where
   blocksVision = not . view open
   description _ = "a door"