Redo tree composition
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
module Dodge.UseAll where
|
||||
import Dodge.Data
|
||||
|
||||
import Control.Lens
|
||||
import qualified Data.Set as S
|
||||
|
||||
toOnward :: String -> Room -> Maybe ([String],Room)
|
||||
toOnward s rm
|
||||
| OnwardCluster `elem` rm ^?! rmClusterStatus . csLinks = Just ([s],rm)
|
||||
| otherwise = Nothing
|
||||
|
||||
toClusterLabel :: Int -> String -> Room -> Maybe ([String],Room)
|
||||
toClusterLabel i s rm
|
||||
| LabelCluster i `elem` rm ^?! rmClusterStatus . csLinks = Just ([s],rm)
|
||||
| otherwise = Nothing
|
||||
|
||||
useAll :: Room -> Room
|
||||
useAll = rmClusterStatus . csLinks .~ S.singleton OnwardCluster
|
||||
|
||||
useSide :: Room -> Room
|
||||
useSide = rmClusterStatus . csLinks .~ S.singleton SideCluster
|
||||
|
||||
useLabel :: Int -> Room -> Room
|
||||
useLabel i = rmClusterStatus . csLinks .~ S.singleton (LabelCluster i)
|
||||
Reference in New Issue
Block a user