Cleanup
This commit is contained in:
+1
-12
@@ -9,7 +9,6 @@ module Dodge.Room.Link
|
||||
, shiftLinkBy
|
||||
, doRoomShift
|
||||
, shuffleLinks
|
||||
, chooseOneInLink
|
||||
, restrictRMInLinksPD
|
||||
) where
|
||||
import Dodge.ShiftPoint
|
||||
@@ -23,21 +22,11 @@ import Data.Tile
|
||||
import Dodge.RoomLink
|
||||
|
||||
import Control.Lens
|
||||
import qualified Data.Set as S
|
||||
|
||||
chooseOneInLink :: RandomGen g => Room -> State g Room
|
||||
chooseOneInLink r = restrictToFstInLink <$> shuffleLinks r
|
||||
--import qualified Data.Set as S
|
||||
|
||||
restrictRMInLinksPD :: ((Point2,Float) -> Bool) -> Room -> Room
|
||||
restrictRMInLinksPD f = rmLinks %~ restrictLinkType InLink f
|
||||
|
||||
restrictToFstInLink :: Room -> Room
|
||||
restrictToFstInLink = rmLinks %~ f
|
||||
where
|
||||
f (rl:xs) | S.member InLink (_rlType rl) = rl : restrictLinkType InLink (const False) xs
|
||||
| otherwise = rl : f xs
|
||||
f [] = []
|
||||
|
||||
{- Shuffle the order of all links of a room randomly.
|
||||
- Note this does not change their types. -}
|
||||
shuffleLinks :: RandomGen g => Room -> State g Room
|
||||
|
||||
Reference in New Issue
Block a user