Continue work on generation annotations

This commit is contained in:
2022-06-12 14:37:56 +01:00
parent 2ccb26b289
commit eeec9248bb
4 changed files with 25 additions and 12 deletions
+18 -6
View File
@@ -42,14 +42,26 @@ import LensHelp
-- xs' <- mapM randomPadCorridors xs
-- return $ treeFromTrunk (replicate n [Corridor]) (Node x xs')
annoToRoomTree :: Annotation -> State StdGen (MetaTree Room)
annoToRoomTree an = case an of
annoToRoomTree' :: Annotation -> State (StdGen,Int) (MetaTree Room)
annoToRoomTree' an = case an of
SpecificRoom r -> zoom _1 r
OnwardList ans -> do
mts <- mapM annoToRoomTree ans
mts <- mapM annoToRoomTree' ans
return $ foldr1 attachOnward mts
SpecificRoom r -> r
PadWith r an -> annoToRoomTree an
IntAnno i f -> annoToRoomTree $ f i
IntAnno' f -> do
(g,i) <- get
put (g,i+1)
annoToRoomTree' (f i)
PadWith r an -> annoToRoomTree' an
--annoToRoomTree :: Annotation -> State StdGen (MetaTree Room)
--annoToRoomTree an = case an of
-- OnwardList ans -> do
-- mts <- mapM annoToRoomTree ans
-- return $ foldr1 attachOnward mts
-- SpecificRoom r -> r
-- PadWith r an -> annoToRoomTree an
-- IntAnno i f -> annoToRoomTree $ f i
attachOnward :: MetaTree Room -> MetaTree Room -> MetaTree Room
attachOnward t1 t2 = case t1 of