diff options
author | Joris Guyonvarch | 2015-03-15 09:40:58 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-15 09:40:58 +0100 |
commit | ce6775641639943a2aee00fa9c2d684aa434bc21 (patch) | |
tree | e5c1b37525cf83f588d82fbf8977ae2839b6e41f /src/View | |
parent | 87386e8b148c2536214fdaf6c3140853c751d7b4 (diff) |
Moving boardSize to Game model
Diffstat (limited to 'src/View')
-rw-r--r-- | src/View/Game.elm | 15 |
1 files changed, 7 insertions, 8 deletions
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] |