From ce6775641639943a2aee00fa9c2d684aa434bc21 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 15 Mar 2015 09:40:58 +0100 Subject: Moving boardSize to Game model --- src/View/Game.elm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/View/Game.elm') diff --git a/src/View/Game.elm b/src/View/Game.elm index 0bbea00..c9c58ff 100644 --- a/src/View/Game.elm +++ b/src/View/Game.elm @@ -14,7 +14,6 @@ import Model.Vec2 (Vec2) import Model.Player (..) import Model.Game (Game) import Model.Point (..) -import Model.Board (boardSize) import Model.Config (..) gameView : Game -> Element @@ -22,15 +21,15 @@ gameView game = let whitePointForms = List.map (pointForm game.time (configColor White)) (game.cloud.points White) blackPointForms = List.map (pointForm game.time (configColor Black)) (game.cloud.points Black) forms = - boardForms + boardForms game.boardSize ++ playerForms game.player ++ whitePointForms ++ blackPointForms - ++ scoreForms game.currentScore - in collage (truncate boardSize.x) (truncate boardSize.y) forms + ++ scoreForms game.boardSize game.currentScore + in collage (truncate game.boardSize.x) (truncate game.boardSize.y) forms -boardForms : List Form -boardForms = [filled boardColor (rect boardSize.x boardSize.y)] +boardForms : Vec2 -> List Form +boardForms boardSize = [filled boardColor (rect boardSize.x boardSize.y)] boardColor : Color boardColor = rgb 103 123 244 @@ -66,8 +65,8 @@ circleForm pos size color = outlineColor : Color outlineColor = rgb 34 34 34 -scoreForms : Int -> List Form -scoreForms score = +scoreForms : Vec2 -> Int -> List Form +scoreForms boardSize score = let text = (toString score) scorePos = { x = 0.0, y = boardSize.y / 2 - 35 } in [textForm text scorePos centered] -- cgit v1.2.3