Continue work on generation annotations
This commit is contained in:
+18
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user