From 5af770bd99dbb57d78857236c054bc0a6dc4bdfd Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 10 May 2015 16:59:08 +0200 Subject: Updating elm version to 0.15 --- src/Update/Update.elm | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/Update/Update.elm') diff --git a/src/Update/Update.elm b/src/Update/Update.elm index 2be00b0..97cf6e3 100644 --- a/src/Update/Update.elm +++ b/src/Update/Update.elm @@ -3,23 +3,25 @@ module Update.Update ) where import List -import Keyboard (KeyCode) -import Char (fromCode, toCode) +import Keyboard exposing (KeyCode) +import Char exposing (fromCode, toCode) import Maybe +import Set +import Set exposing (Set) -import Model.Player (..) -import Model.Vec2 (..) -import Model.Config (otherConfig) -import Model.Cloud (..) -import Model.Game (..) -import Model.Round (Round) +import Model.Player exposing (..) +import Model.Vec2 exposing (..) +import Model.Config exposing (otherConfig) +import Model.Cloud exposing (..) +import Model.Game exposing (..) +import Model.Round exposing (Round) -import Utils.Geometry (..) -import Utils.Physics (getNewPosAndSpeed) +import Utils.Geometry exposing (..) +import Utils.Physics exposing (getNewPosAndSpeed) -import Update.CloudUpdate (cloudUpdate) +import Update.CloudUpdate exposing (cloudUpdate) -import Input (Input) +import Input exposing (Input) update : Input -> Game -> Game update input game = @@ -54,7 +56,7 @@ playerStep dt boardSize dir newKey player = , config = newConfig } -newKeyCode : List KeyCode -> List KeyCode -> KeyCode -> Bool +newKeyCode : Set KeyCode -> Set KeyCode -> KeyCode -> Bool newKeyCode lastKeyCodes newKeyCodes keyCode = - let contains = not << List.isEmpty << List.filter (\kc -> kc == keyCode) + let contains = not << List.isEmpty << List.filter (\kc -> kc == keyCode) << Set.toList in not (contains lastKeyCodes) && (contains newKeyCodes) -- cgit v1.2.3