module Dodge.Wall.Create where import Dodge.Data import Dodge.Wall.Zone import Control.Lens import qualified IntMapHelp as IM createWall :: Wall -> World -> (Int,World) createWall wl w = (wlid , w & walls %~ IM.insert wlid newwl & insertWallInZones newwl ) where newwl = wl {_wlID = wlid} wlid = IM.newKey $ _walls w