This commit is contained in:
2022-06-14 16:13:06 +01:00
parent a20602abdb
commit d0e3500cad
11 changed files with 106 additions and 38 deletions
+6 -2
View File
@@ -13,6 +13,7 @@ module Dodge.Tree.Compose
, attachTree
, toOnward
, attachOnward
, attachOnward'
, showIntsString
, module Dodge.Tree.Compose.Data
) where
@@ -90,8 +91,11 @@ attachBranch mb = safeUpdateSingleNode (isJust . upf . snd)
tToBTree :: String -> Tree Room -> MetaTree Room String
tToBTree str t = MTree str (NodeTree t) []
attachOnward :: MetaTree Room b -> MetaTree Room b -> MetaTree Room b
attachOnward t1 t2 = t1 & mtBranches .:~ MBranch toOnward t2
attachOnward :: b -> MetaTree Room b -> MetaTree Room b -> MetaTree Room b
attachOnward s t1 t2 = MTree s (NodeMTree t1) [MBranch toOnward t2]
attachOnward' :: MetaTree Room b -> MetaTree Room b -> MetaTree Room b
attachOnward' t1 t2 = MTree (_mtLabel t1) (NodeMTree t1) [MBranch toOnward t2]
toOnward :: Room -> Maybe Room
toOnward rm