{-
Collections of rooms that branch into multiple paths.
-}
module Dodge.Room.Branch
    where
--import Geometry
import Dodge.LevelGen.Data
import Dodge.Room.Door
import Dodge.Room.Link
import Dodge.Room.Procedural
--import Dodge.LevelGen.Data
import Dodge.Tree

import Control.Monad.State
import System.Random
import Data.Tree

branchRectWith :: RandomGen g => State g (SubCompTree Room) ->  State g (SubCompTree Room)
branchRectWith t = do
    x <- state $ randomR (100,200)
    y <- state $ randomR (100,200)
    b <- t
    root <- randomiseOutLinks $ roomRectAutoLinks x y
    return $ Node (PassDown root) [Node (UseAll door) [], changeToPassDown <$> 
        treeFromTrunk [PassDown door] b]
