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