Cleanup
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
{-
|
||||
Rooms that contain two doors and a switch alternating both. -}
|
||||
module Dodge.Room.Airlock
|
||||
where
|
||||
{- Rooms that contain two doors and a switch alternating both. -}
|
||||
module Dodge.Room.Airlock where
|
||||
import Dodge.Room.Data
|
||||
import Dodge.LightSources.Fitting
|
||||
import Dodge.Room.Placement
|
||||
@@ -15,49 +13,18 @@ import Dodge.RandomHelp
|
||||
import Geometry
|
||||
import Picture
|
||||
|
||||
import qualified Data.Map.Strict as M
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import System.Random
|
||||
import Control.Monad.State
|
||||
import Control.Lens
|
||||
|
||||
airlockOneWay :: Int -> Room
|
||||
airlockOneWay n = defaultRoom
|
||||
{ _rmPolys = [rectNSWE 90 0 0 40]
|
||||
, _rmLinks = lnks
|
||||
, _rmPath = []
|
||||
, _rmPS = [sPS (V2 0 15) 0 $ PutDoubleDoor col (not . cond) (V2 0 0) (V2 0 40) 2
|
||||
,sPS (V2 0 75) 0 $ PutDoubleDoor col cond (V2 0 0) (V2 0 40) 2
|
||||
,sPS (V2 35 45) (pi/2) $ PutButton $ makeButton col (over worldState
|
||||
(M.insert (DoorNumOpen n) True))
|
||||
]
|
||||
--, _rmBound = rectNSWE 90 30 (-30) 30
|
||||
, _rmBound = [rectNSWE 75 15 0 40]
|
||||
}
|
||||
where lnks = [(V2 0 85,0)
|
||||
,(V2 0 5,pi)
|
||||
]
|
||||
cond w = or $ M.lookup (DoorNumOpen n) (_worldState w)
|
||||
col = dim $ dim $ bright red
|
||||
|
||||
{- |
|
||||
A passage with a switch that opens forward access while closing backwards access. -}
|
||||
{- | A passage with a switch that opens forward access while closing backwards access. -}
|
||||
airlock :: RandomGen g => State g Room
|
||||
--airlock = takeOne [airlock0,airlock90,airlockCrystal]
|
||||
airlock = takeOne [airlock0]
|
||||
|
||||
{- |
|
||||
Straight airlock -}
|
||||
airlock = takeOne [airlock0,airlock90,airlockCrystal]
|
||||
{- | Straight airlock -}
|
||||
airlock0 :: Room
|
||||
airlock0 = defaultRoom
|
||||
{ _rmPolys =
|
||||
[ rectNSWE 100 0 0 40
|
||||
, rectNSWE 65 35 (-40) 20
|
||||
]
|
||||
{ _rmPolys = [ rectNSWE 100 0 0 40 , rectNSWE 65 35 (-40) 20 ]
|
||||
, _rmLinks = lnks
|
||||
, _rmPath = [(V2 20 95,V2 20 45)
|
||||
,(V2 20 45,V2 20 5)
|
||||
]
|
||||
, _rmPath = [(V2 20 95,V2 20 45) ,(V2 20 45,V2 20 5) ]
|
||||
, _rmPS =
|
||||
[Placement (PS (V2 (-35) 50) (negate $ pi/2) $ PutButton $ makeSwitch col red id id)
|
||||
$ \btid -> jspsJ (V2 0 20) 0 (PutDoubleDoor col (not . cond' btid) (V2 1 0) (V2 39 0) 2)
|
||||
@@ -74,8 +41,7 @@ airlock0 = defaultRoom
|
||||
cond' btid w' = _btState (_buttons w' IM.! btid) == BtOn
|
||||
col = dim $ dim $ bright red
|
||||
|
||||
airlock90
|
||||
:: Room
|
||||
airlock90 :: Room
|
||||
airlock90 = defaultRoom
|
||||
{ _rmPolys =
|
||||
[ rectNSWE 100 10 10 100
|
||||
|
||||
Reference in New Issue
Block a user