diff options
author | Griffin Smith <root@gws.fyi> | 2020-01-25T16·38-0500 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2020-01-25T16·38-0500 |
commit | 308c7eb4f6cd1e7bb333e438bb4e6c904d9c20ee (patch) | |
tree | 299e5788dd029ae9258b1af9101ba42c0e77cdc6 /src/Xanthous/Entities/Environment.hs | |
parent | 9256c976edec462af26f33317df6171045e68aa5 (diff) |
Add a close command
Add a close command, to close doors, that works basically the same as the open command.
Diffstat (limited to 'src/Xanthous/Entities/Environment.hs')
-rw-r--r-- | src/Xanthous/Entities/Environment.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Xanthous/Entities/Environment.hs b/src/Xanthous/Entities/Environment.hs index 993714c844c5..430ce1b7a99e 100644 --- a/src/Xanthous/Entities/Environment.hs +++ b/src/Xanthous/Entities/Environment.hs @@ -7,6 +7,7 @@ module Xanthous.Entities.Environment -- * Doors , Door(..) , open + , closed , locked , unlockedDoor @@ -99,6 +100,9 @@ instance Entity Door where entityCollision door | door ^. open = Nothing | otherwise = Just Stop +closed :: Lens' Door Bool +closed = open . involuted not + -- | A closed, unlocked door unlockedDoor :: Door unlockedDoor = Door |