make maze generation lazy

main
Brian Hicks 2 years ago
parent 0fd2656199
commit 9a00e919c8

@ -12,6 +12,7 @@ import Html.Events.Extra.Touch as Touch exposing (Touch)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as HAttrs exposing (css)
import Html.Styled.Events as Events
import Html.Styled.Lazy as Lazy
import Json.Decode as Decode
import Maze exposing (Maze)
import Random
@ -225,9 +226,7 @@ view model =
Route.Maze info ->
[ viewMazeControls
, viewCanvas model
, baseMaze info
|> Maze.generate (Random.initialSeed info.seed)
|> viewMaze
, Lazy.lazy carveAndView info
]
Route.NotFound ->
@ -238,6 +237,13 @@ view model =
}
carveAndView : { width : Int, height : Int, shape : Route.MazeShape, seed : Int } -> Html msg
carveAndView params =
baseMaze params
|> Maze.generate (Random.initialSeed params.seed)
|> viewMaze
viewNewFormControls : Model -> Html Msg
viewNewFormControls model =
controlsBar

Loading…
Cancel
Save