Commit before further changes to MetaTrees
This commit is contained in:
+3
-18
@@ -1,7 +1,6 @@
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
module Dodge.UseAll
|
||||
( toOnward'
|
||||
, toLabel'
|
||||
( toLabel
|
||||
, cleatOnward
|
||||
, cleatSide
|
||||
, rToOnward
|
||||
@@ -9,33 +8,19 @@ module Dodge.UseAll
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Tree.Compose
|
||||
import Dodge.Tree.Compose.Data
|
||||
|
||||
import Data.Tree
|
||||
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 & rmClusterStatus . csLinks . at OnwardCluster .~ Nothing)
|
||||
| otherwise = Nothing
|
||||
|
||||
|
||||
toLabel' :: Int -> Room -> Maybe Room
|
||||
toLabel' i rm
|
||||
toLabel :: Int -> Room -> Maybe Room
|
||||
toLabel i rm
|
||||
| LabelCluster i `elem` rm ^?! rmClusterStatus . csLinks = Just rm
|
||||
| otherwise = Nothing
|
||||
|
||||
rToOnward :: Monad m => String -> Tree Room -> m (MetaTree Room)
|
||||
rToOnward s t = return $ MTree s (tToBTree t) []
|
||||
|
||||
|
||||
toClusterLabel :: Int -> String -> Room -> Maybe ([String],Room)
|
||||
toClusterLabel i s rm
|
||||
| LabelCluster i `elem` rm ^?! rmClusterStatus . csLinks = Just ([s],rm)
|
||||
| otherwise = Nothing
|
||||
|
||||
cleatOnward :: Room -> Room
|
||||
cleatOnward = rmClusterStatus . csLinks .~ S.singleton OnwardCluster
|
||||
|
||||
|
||||
Reference in New Issue
Block a user