Tweak tree level generation
This commit is contained in:
@@ -28,6 +28,16 @@ addLock i t = do
|
||||
padCorridors :: Tree [Annotation] -> Tree [Annotation]
|
||||
padCorridors (Node x xs) = Node [Corridor] [Node x (map padCorridors xs)]
|
||||
|
||||
randomPadCorridors :: RandomGen g => Tree [Annotation] -> State g (Tree [Annotation])
|
||||
randomPadCorridors (Node x xs) = do
|
||||
n <- state $ randomR (1, 3)
|
||||
xs' <- mapM randomPadCorridors xs
|
||||
return $ treeTrunk (replicate n [Corridor]) (Node x xs')
|
||||
|
||||
annoToRoom :: RandomGen g => [Annotation] -> State g Room
|
||||
annoToRoom [Corridor] = takeOne [corridor]
|
||||
annoToRoom _ = randLinks $ roomRectAutoLinks 200 200
|
||||
|
||||
annoToRoom' :: [Annotation] -> Room
|
||||
annoToRoom' [Corridor] = corridor
|
||||
annoToRoom' _ = roomRectAutoLinks 200 200
|
||||
|
||||
Reference in New Issue
Block a user