Simplify layout Annotations
This commit is contained in:
+12
-10
@@ -14,22 +14,24 @@ import Dodge.Tree
|
||||
import LensHelp
|
||||
import RandomHelp
|
||||
|
||||
annoToRoomTree :: Annotation -> State (StdGen, Int) MTRS
|
||||
annoToRoomTree :: Annotation -> State LayoutVars MTRS
|
||||
annoToRoomTree an = case an of
|
||||
AnTree t -> zoom _1 t
|
||||
AnTree t -> t
|
||||
-- AnRoom r -> MTree "SingleRoom" . NodeTree . pure . (rmClusterStatus . csLinks . at OnwardCluster ?~ ()) <$> zoom _1 r <*> return []
|
||||
OnwardList ans -> do
|
||||
mts <- mapM annoToRoomTree ans
|
||||
return $ foldr1 attachOnward' mts
|
||||
IntAnno f -> do
|
||||
(g, i) <- get
|
||||
put (g, i + 1)
|
||||
annoToRoomTree (f i)
|
||||
PassthroughLockKeyLists ls ks i -> zoom _1 $ do
|
||||
-- IntAnno f -> do
|
||||
-- LayVars g i <- get
|
||||
-- put $ LayVars g (i + 1)
|
||||
-- annoToRoomTree (f i)
|
||||
--PassthroughLockKeyLists ls ks i -> zoom lyGen $ do
|
||||
PassthroughLockKeyLists ls ks -> do
|
||||
i <- nextLayoutInt
|
||||
(functionlockroom, randomitemidentity) <- takeOne ls
|
||||
lr <- functionlockroom i
|
||||
ii <- randomitemidentity
|
||||
keyroom <- fromJust $ lookup ii ks
|
||||
lr <- zoom lyGen $ functionlockroom i
|
||||
ii <- zoom lyGen $ randomitemidentity
|
||||
keyroom <- zoom lyGen . fromJust $ lookup ii ks
|
||||
return $
|
||||
MTree
|
||||
("PassthroughLockKeyLists-" ++ show ii)
|
||||
|
||||
Reference in New Issue
Block a user