Continue link cleanup
This commit is contained in:
@@ -15,7 +15,6 @@ module Dodge.Room.Link
|
||||
, shuffleLinks
|
||||
, filterLinks
|
||||
, changeLinkTo
|
||||
, changeLinkFrom
|
||||
, randomiseOutLinks
|
||||
, chooseOneInLink
|
||||
, restrictRMInLinksPD
|
||||
@@ -93,14 +92,6 @@ filterLinks :: RandomGen g => ((Point2,Float) -> Bool) -> Room -> State g Room
|
||||
filterLinks cond r = do
|
||||
newLinks <- shuffle $ filter (cond . lnkPosDir) $ _rmLinks r
|
||||
return $ r {_rmLinks = newLinks}
|
||||
{- | Swaps the first link in the list with one that satisfies a given property.
|
||||
- Does not change the last link in the list -}
|
||||
-- TODO replace all instances of this with something more sensible
|
||||
changeLinkFrom :: RandomGen g => ((Point2,Float) -> Bool) -> Room -> State g Room
|
||||
changeLinkFrom cond r = do
|
||||
let (possibleLnks,otherLnks) = partition (cond . lnkPosDir) $ _rmLinks r
|
||||
newLnks <- shuffle possibleLnks
|
||||
return $ r {_rmLinks = newLnks ++ otherLnks}
|
||||
{- | Swaps the last link in the list with one that satisfies a given
|
||||
- property (it might swap with itself). Unsafe.
|
||||
- Be careful about calling this after changeLinkFrom. -}
|
||||
|
||||
Reference in New Issue
Block a user