about summary refs log tree commit diff
path: root/src/Xanthous/Entities
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-12-30T17·30-0500
committerGriffin Smith <root@gws.fyi>2019-12-30T17·30-0500
commitdcf44f29f5df75dedae62a9820b06d7c4cd36df1 (patch)
treeb713100df2e1a58c015af53771f0263ea4250f7a /src/Xanthous/Entities
parente76567b9e776070812838828d8de8220c2a461e7 (diff)
Place doors on the level
Pick a random subset of cells on the level that have a wall on two
opposite sides and are clear on the other two sides, and place closed,
unlocked doors on those cells.
Diffstat (limited to 'src/Xanthous/Entities')
-rw-r--r--src/Xanthous/Entities/Environment.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Xanthous/Entities/Environment.hs b/src/Xanthous/Entities/Environment.hs
index 0690e47e5441..c34f2e0634d6 100644
--- a/src/Xanthous/Entities/Environment.hs
+++ b/src/Xanthous/Entities/Environment.hs
@@ -7,6 +7,7 @@ module Xanthous.Entities.Environment
   , Door(..)
   , open
   , locked
+  , unlockedDoor
     -- * Messages
   , GroundMessage(..)
   ) where
@@ -88,6 +89,13 @@ instance Entity Door where
   description _ = "a door"
   entityChar _ = "d"
 
+-- | A closed, unlocked door
+unlockedDoor :: Door
+unlockedDoor = Door
+  { _open = False
+  , _locked = False
+  }
+
 --------------------------------------------------------------------------------
 
 newtype GroundMessage = GroundMessage Text