--{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.LevelGen.LevelStructure 
    ( module Dodge.LevelGen.Data
    , worldToGenWorld
    ) where
import Dodge.LevelGen.Data
--import Dodge.Tree.Compose.Data
import Dodge.Data
import RandomHelp
import Color
import LensHelp

--import Data.Tree
import qualified Data.IntMap.Strict as IM
import qualified Data.Map.Strict as M
--import Control.Lens

worldToGenWorld :: IM.IntMap Room -> World -> World
worldToGenWorld rms w = w 
    & genParams .~ evalState generateGenParams (_randGen w)
    & genRooms .~ rms

generateGenParams :: RandomGen g => State g GenParams
generateGenParams = do
    cols <- shuffle [RED .. ORANGE]
    shps <- shuffle [PLUS ..]
    return 
        . GenParams 
        . M.fromList 
        . zip [FLAMING,LASERING,ELECTRICAL]
        $ zip cols shps
