Commit before further changes to MetaTrees

This commit is contained in:
2022-06-13 09:49:43 +01:00
parent dbba78ef05
commit 768b86d393
6 changed files with 38 additions and 54 deletions
+3 -18
View File
@@ -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