Refactoring, add screen when generating level
This commit is contained in:
@@ -5,6 +5,7 @@ module Dodge.Layout.Tree.Either
|
||||
( expandTreeBy
|
||||
, appendEitherTree
|
||||
, connectRoom
|
||||
, connectTrunk
|
||||
, deadRoom
|
||||
) where
|
||||
import Data.Tree
|
||||
@@ -40,6 +41,13 @@ Make a singleton connection of an Either Tree.
|
||||
connectRoom :: a -> Tree (Either a a)
|
||||
connectRoom r = Node (Right r) []
|
||||
|
||||
{- |
|
||||
Make a single Either connection at the end of a tree.
|
||||
-}
|
||||
connectTrunk :: Tree a -> Tree (Either a a)
|
||||
connectTrunk (Node x (t:ts)) = Node (Left x) (connectTrunk t : map (fmap Left) ts)
|
||||
connectTrunk (Node x []) = Node (Right x) []
|
||||
|
||||
{- |
|
||||
Make a singleton dead end of an Either Tree.
|
||||
-}
|
||||
|
||||
Reference in New Issue
Block a user