aboutsummaryrefslogtreecommitdiff
path: root/src/Update/Update.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-05-10 16:59:08 +0200
committerJoris Guyonvarch2015-05-10 16:59:08 +0200
commit5af770bd99dbb57d78857236c054bc0a6dc4bdfd (patch)
treea15a021df539302767281296c66bb8fdf2d0bae1 /src/Update/Update.elm
parentd5ec91d4d01db6f4d476522d5b14e116435ebb7d (diff)
Updating elm version to 0.15
Diffstat (limited to 'src/Update/Update.elm')
-rw-r--r--src/Update/Update.elm30
1 files changed, 16 insertions, 14 deletions
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)