aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Round.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-08 13:26:52 +0100
committerJoris Guyonvarch2015-03-08 13:29:01 +0100
commit97e494a7c5a105bba6a48f5025e71a376fc8673d (patch)
tree9cd83b9fedfa4787e6237fadce4dfd2d43faa0d6 /src/Model/Round.elm
parent6c1f5e10631a3f66f4c85a45b6f28ffd366105c5 (diff)
downloadcatchvoid-97e494a7c5a105bba6a48f5025e71a376fc8673d.tar.gz
catchvoid-97e494a7c5a105bba6a48f5025e71a376fc8673d.tar.bz2
catchvoid-97e494a7c5a105bba6a48f5025e71a376fc8673d.zip
Save round durations
Diffstat (limited to 'src/Model/Round.elm')
-rw-r--r--src/Model/Round.elm19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Model/Round.elm b/src/Model/Round.elm
new file mode 100644
index 0000000..d5210d5
--- /dev/null
+++ b/src/Model/Round.elm
@@ -0,0 +1,19 @@
+module Model.Round
+ ( Round
+ , roundOrder
+ ) where
+
+import Time (Time)
+
+type alias Round =
+ { duration : Time
+ , score : Int
+ }
+
+roundOrder : Round -> Round -> Order
+roundOrder round1 round2 =
+ if round1.score == round2.score
+ then
+ compare round2.duration round1.duration
+ else
+ compare round1.score round2.score